Add more logging for execution requests

This commit is contained in:
Sebastian Serth
2021-11-18 14:18:41 +01:00
parent c90e02e4f1
commit 5aee2aaba8
2 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,7 @@ class Runner < ApplicationRecord
end
def attach_to_execution(command, &block)
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Starting execution with Runner #{id} for #{user_type} #{user_id}." }
starting_time = Time.zone.now
begin
# As the EventMachine reactor is probably shared with other threads, we cannot use EventMachine.run with
@ -68,6 +69,7 @@ class Runner < ApplicationRecord
e.execution_duration = Time.zone.now - starting_time
raise
end
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Stopped execution with Runner #{id} for #{user_type} #{user_id}." }
Time.zone.now - starting_time # execution duration
end