Skip to content

Commit

Permalink
Fixes #37242 - Fix live output appearing multiple times
Browse files Browse the repository at this point in the history
The result of calling continuous_output was not persisted, so the
original code didn't make much sense. ContinuousOutput#sort! returns the
same thing as ContinuousOutput#raw_outputs so we can skip the second
line completely.

Upsert_all was updating the already existing values, so exit_status got
updated multiple times with different timestamps. Insert_all should just
skip over the already existing values.
  • Loading branch information
adamruzicka authored and ofedoren committed Mar 12, 2024
1 parent c88cf2c commit 897a9fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion app/lib/actions/remote_execution/proxy_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def process_proxy_data(data)
}
end
events.each_slice(1000) do |batch|
TemplateInvocationEvent.upsert_all(batch, unique_by: [:template_invocation_id, :sequence_id]) # rubocop:disable Rails/SkipsModelValidations
TemplateInvocationEvent.insert_all(batch, unique_by: [:template_invocation_id, :sequence_id]) # rubocop:disable Rails/SkipsModelValidations
end
end
end
Expand Down
1 change: 0 additions & 1 deletion app/lib/actions/remote_execution/run_host_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def check_exit_status

def live_output
continuous_output.sort!
continuous_output.raw_outputs
end

def humanized_input
Expand Down

0 comments on commit 897a9fb

Please sign in to comment.