# send message to log table. we want these records to be transient
def write_log running_job
- if (running_job && running_job[:stderr_buf] != '')
+ begin
+ if (running_job && running_job[:stderr_buf_to_flush] != '')
log = Log.new(object_uuid: running_job[:job].uuid,
event_type: 'stderr',
- properties: {"text" => running_job[:stderr_buf]})
+ owner_uuid: running_job[:job].owner_uuid,
+ properties: {"text" => running_job[:stderr_buf_to_flush]})
log.save!
- running_job[:stderr_buf] = ''
+ running_job[:stderr_buf_to_flush] = ''
running_job[:stderr_flushed_at] = Time.now.to_i
end
rescue