263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
# File 'lib/workflow_manager/server.rb', line 263
def update_time_status(job_id, current_status, script_name, user, project_number)
@statuses.transaction do |statuses|
start_time = nil
if stat = statuses[job_id]
last_status, script_name, start_time, user, project_number = stat.split(/,/)
end
time = if start_time
if current_status == 'success' or current_status == 'fail'
start_time + '/' + Time.now.strftime("%Y-%m-%d %H:%M:%S")
elsif current_status != last_status
Time.now.strftime("%Y-%m-%d %H:%M:%S")
end
else
Time.now.strftime("%Y-%m-%d %H:%M:%S")
end
if time
statuses[job_id] = [current_status, script_name, time, user, project_number].join(',')
end
end
end
|