Show correct timeout message on timeout. Do not show a message on valid exit.

This commit is contained in:
Ralf Teusner
2015-10-21 17:18:28 +02:00
parent 889d7562f9
commit 30d0270744
3 changed files with 17 additions and 10 deletions

View File

@ -90,6 +90,12 @@ class SubmissionsController < ApplicationController
hijack do |tubesock|
Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?
# socket is the socket into the container, tubesock is the socket to the client
# give the docker_client the tubesock object, so that it can send messages (timeout)
@docker_client.tubesock = tubesock
result = @docker_client.execute_run_command(@submission, params[:filename])
tubesock.send_data JSON.dump({'cmd' => 'status', 'status' => result[:status]})