Skip to content

Commit

Permalink
Don't call .presence on program stdout and stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanzdosilovic committed Feb 10, 2019
1 parent 2f05ce2 commit ff63c1b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/jobs/isolate_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,17 @@ def verify
change_permissions
parse_meta

program_stdout = File.read(stdout)
program_stderr = File.read(stderr)

program_stdout = nil if program_stdout.empty?
program_stderr = nil if program_stderr.empty?

submission.time = parsed_meta[:time]
submission.wall_time = parsed_meta[:"time-wall"]
submission.memory = (cgroups.present? ? parsed_meta[:"cg-mem"] : parsed_meta[:"max-rss"])
submission.stdout = File.read(stdout).presence
submission.stderr = File.read(stderr).presence
submission.stdout = program_stdout
submission.stderr = program_stderr
submission.exit_code = parsed_meta[:exitcode].try(:to_i) || 0
submission.exit_signal = parsed_meta[:exitsig].try(:to_i)
submission.message = parsed_meta[:message]
Expand Down

0 comments on commit ff63c1b

Please sign in to comment.