Prevent parsing error for empty client commands
This commit is contained in:
@ -184,6 +184,8 @@ class SubmissionsController < ApplicationController
|
|||||||
# Check whether the client send a JSON command and kill container
|
# Check whether the client send a JSON command and kill container
|
||||||
# if the command is 'client_kill', send it to docker otherwise.
|
# if the command is 'client_kill', send it to docker otherwise.
|
||||||
begin
|
begin
|
||||||
|
next if data == "\n"
|
||||||
|
|
||||||
parsed = JSON.parse(data)
|
parsed = JSON.parse(data)
|
||||||
if parsed.class == Hash && parsed['cmd'] == 'client_kill'
|
if parsed.class == Hash && parsed['cmd'] == 'client_kill'
|
||||||
Rails.logger.debug("Client exited container.")
|
Rails.logger.debug("Client exited container.")
|
||||||
|
Reference in New Issue
Block a user