Print no_output message also for Python container

This commit is contained in:
Sebastian Serth
2020-11-24 00:46:39 +01:00
parent 6c5052ed84
commit 8c04ecdfd1

View File

@ -222,7 +222,7 @@ class SubmissionsController < ApplicationController
# For Python containers, the @run_output is '{"cmd":"exit"}' as a string. # For Python containers, the @run_output is '{"cmd":"exit"}' as a string.
# If this is the case, we should consider it as blank # If this is the case, we should consider it as blank
if @run_output.blank? || @run_output&.strip == '{"cmd":"exit"}' if @run_output.blank? || @run_output&.strip == '{"cmd":"exit"}' || @run_output&.strip == 'timeout:'
@raw_output ||= '' @raw_output ||= ''
@run_output ||= '' @run_output ||= ''
parse_message t('exercises.implement.no_output', timestamp: l(Time.now, format: :short)), 'stdout', tubesock parse_message t('exercises.implement.no_output', timestamp: l(Time.now, format: :short)), 'stdout', tubesock
@ -237,7 +237,7 @@ class SubmissionsController < ApplicationController
@raw_output ||= '' @raw_output ||= ''
@run_output ||= '' @run_output ||= ''
# Handle special commands first # Handle special commands first
if /^#exit/.match(message) if /^#exit|^{"cmd": "exit"}/.match(message)
# Just call exit_container on the docker_client. # Just call exit_container on the docker_client.
# Do not call kill_socket for the websocket to the client here. # Do not call kill_socket for the websocket to the client here.
# @docker_client.exit_container closes the socket to the container, # @docker_client.exit_container closes the socket to the container,