Skip to content

Commit

Permalink
Merge pull request #16957 from eduardoj/refactoring/remove_retrying_iii
Browse files Browse the repository at this point in the history
Remove unnecesary retrying on updating a package
  • Loading branch information
hennevogel authored Jan 24, 2025
2 parents 5fa8e00 + 4c8b5f9 commit 09f7c57
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/api/app/models/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,18 +460,8 @@ def sources_changed(opts = {})
if opts[:wait_for_update]
update_if_dirty
else
retries = 10
begin
# NOTE: Its important that this job run in queue 'default' in order to avoid concurrency
PackageUpdateIfDirtyJob.perform_later(id)
rescue ActiveRecord::StatementInvalid => e
# mysql lock errors in delayed job handling... we need to retry
retries -= 1
if retries.positive?
Airbrake.notify("Failed while running PackageUpdateIfDirtyJob: retries left: #{retries}, package_id: #{id}, #{e}")
retry
end
end
# NOTE: Its important that this job run in queue 'default' in order to avoid concurrency
PackageUpdateIfDirtyJob.perform_later(id)
end
end

Expand Down

0 comments on commit 09f7c57

Please sign in to comment.