From e65863586e67c7def2eeb9f730f7835d94bd4341 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Tue, 19 Nov 2013 00:16:22 -0800 Subject: [PATCH] Send job log messages to owner_uuid redis channel --- services/api/script/crunch-dispatch.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb index a0ba9b1fde..88840d53b6 100755 --- a/services/api/script/crunch-dispatch.rb +++ b/services/api/script/crunch-dispatch.rb @@ -163,6 +163,7 @@ class Dispatcher $stderr.puts start_banner $redis.set job.uuid, start_banner + "\n" $redis.publish job.uuid, start_banner + $redis.publish job.owner_uuid, start_banner @running[job.uuid] = { stdin: i, @@ -218,8 +219,10 @@ class Dispatcher lines.each do |line| $stderr.print "#{job_uuid} ! " unless line.index(job_uuid) $stderr.puts line - $redis.publish job_uuid, "#{Time.now.ctime.to_s} #{line.strip}" - $redis.append job_uuid, "#{Time.now.ctime.to_s} #{line}" + pub_msg = "#{Time.now.ctime.to_s} #{line.strip}" + $redis.publish job.owner_uuid, pub_msg + $redis.publish job_uuid, pub_msg + $redis.append job_uuid, pub_msg + "\n" if LOG_BUFFER_SIZE < $redis.strlen(job_uuid) $redis.set(job_uuid, $redis -- 2.30.2