Skip to content

Commit

Permalink
Refs #35806 - Add missing sequence id handling
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka authored and ares committed Dec 9, 2022
1 parent 35dfde1 commit a9ae8f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/lib/actions/remote_execution/proxy_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def process_proxy_data(data)
}
end
if data['exit_status']
last = events.last || {:sequence_id => -1, :timestamp => Time.zone.now}
events << {
sequence_id: events.last[:sequence_id] + 1,
sequence_id: last[:sequence_id] + 1,
template_invocation_id: template_invocation.id,
event: data['exit_status'],
timestamp: events.last[:timestamp],
timestamp: last[:timestamp],
event_type: 'exit',
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ def template_invocation
end

def log_template_invocation_exception(exception)
last = template_invocation.template_invocation_events.order(:sequence_id).last
id = last ? last.sequence_id + 1 : 0
template_invocation.template_invocation_events.create!(
:event_type => 'debug',
:event => "#{exception.class}: #{exception.message}",
:timestamp => Time.zone.now
:timestamp => Time.zone.now,
:sequence_id => id
)
end

Expand Down

0 comments on commit a9ae8f2

Please sign in to comment.