Skip to content

Commit

Permalink
Return nil if we cannot strip given output. Change finished_at dateti…
Browse files Browse the repository at this point in the history
…me only if it does not exist.

Update documentation for v1.1.1 release.
  • Loading branch information
hermanzdosilovic committed Feb 13, 2019
1 parent 77e64d0 commit b25153e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ CMD rm -f tmp/pids/server.pid && \
rails s -b 0.0.0.0

LABEL maintainer="Herman Zvonimir Došilović, [email protected]" \
version="1.1.0"
version="1.1.1"
14 changes: 7 additions & 7 deletions app/jobs/isolate_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ def compile
submission.compile_output = "Compilation time limit exceeded."
end

submission.update(
status: Status.ce,
finished_at: DateTime.now
)
submission.finished_at ||= DateTime.now
submission.status = Status.ce
submission.save

return :failure
end
Expand Down Expand Up @@ -108,10 +107,10 @@ def run
end

def verify
submission.finished_at = DateTime.now
submission.finished_at ||= DateTime.now

change_permissions
parse_meta
change_permissions()
parse_meta()

program_stdout = File.read(stdout)
program_stderr = File.read(stderr)
Expand Down Expand Up @@ -164,6 +163,7 @@ def determine_status
end

def strip_output(output)
return nil unless output
output.split("\n").collect(&:rstrip).join("\n").rstrip
end
end
2 changes: 1 addition & 1 deletion docs/api/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Source code is available on [GitHub](https://github.com/judge0/api).
Dummy client is available [here](/dummy-client.html) and can be used to try and test features of Judge0 API.

# Version
This document describes Judge0 API version [`v1.1.0`](https://github.com/judge0/api/tree/v1.1.0).
This document describes Judge0 API version [`v1.1.1`](https://github.com/judge0/api/tree/v1.1.1).

# Date and time formats
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard is used.
Expand Down
2 changes: 1 addition & 1 deletion public/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 id="header-about">About <a class="permalink" href="#header-about" aria-hidde
Source code is available on <a href="https://github.com/judge0/api">GitHub</a>.</p>
<p>Dummy client is available <a href="/dummy-client.html">here</a> and can be used to try and test features of Judge0 API.</p>
<h1 id="header-version">Version <a class="permalink" href="#header-version" aria-hidden="true"></a></h1>
<p>This document describes Judge0 API version <a href="https://github.com/judge0/api/tree/v1.1.0"><code>v1.1.0</code></a>.</p>
<p>This document describes Judge0 API version <a href="https://github.com/judge0/api/tree/v1.1.1"><code>v1.1.1</code></a>.</p>
<h1 id="header-date-and-time-formats">Date and time formats <a class="permalink" href="#header-date-and-time-formats" aria-hidden="true"></a></h1>
<p><a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> standard is used.</p>
<p>Example: <code>2016-09-11T10:19:35Z</code></p>
Expand Down

0 comments on commit b25153e

Please sign in to comment.