send exit commands from rails server when score or test have finished - this is needed to reset the buttons in the frontend correctly.

This commit is contained in:
Ralf Teusner
2016-09-01 17:15:44 +02:00
parent 9ec9f01257
commit 0d550a44af

View File

@ -232,6 +232,7 @@ class SubmissionsController < ApplicationController
Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?
# tubesock is the socket to the client
tubesock.send_data JSON.dump(score_submission(@submission))
tubesock.send_data JSON.dump({'cmd' => 'exit'})
end
end
@ -291,6 +292,7 @@ class SubmissionsController < ApplicationController
# tubesock is the socket to the client
tubesock.send_data JSON.dump(output)
tubesock.send_data JSON.dump('cmd' => 'exit')
end
end