Attach duration information to the exception object

This commit is contained in:
Felix Auringer
2021-06-28 12:03:20 +02:00
committed by Sebastian Serth
parent 36578a2817
commit 2dff81a510
9 changed files with 87 additions and 57 deletions

View File

@ -53,7 +53,6 @@ class Runner::Strategy::DockerContainerPool < Runner::Strategy
def attach_to_execution(command)
@command = command
starting_time = Time.zone.now
query_params = 'logs=0&stream=1&stderr=1&stdout=1&stdin=1'
websocket_url = "#{self.class.config[:ws_host]}/v1.27/containers/#{@container_id}/attach/ws?#{query_params}"
@ -66,7 +65,6 @@ class Runner::Strategy::DockerContainerPool < Runner::Strategy
socket.send(command)
yield(socket)
end
Time.zone.now - starting_time # execution duration in seconds
end
private

View File

@ -86,13 +86,11 @@ class Runner::Strategy::Poseidon < Runner::Strategy
end
def attach_to_execution(command)
starting_time = Time.zone.now
websocket_url = execute_command(command)
EventMachine.run do
socket = Connection.new(websocket_url, self)
yield(socket)
end
Time.zone.now - starting_time # execution duration
end
def destroy_at_management