Skip to content

Commit

Permalink
Remove retrying on updating a package
Browse files Browse the repository at this point in the history
If updating a package results in an error, just retrying 10 times to
update it doesn't make a difference.

Correct handling of concurrent updates of packages is guaranteed using
Active Jobs.
  • Loading branch information
eduardoj committed Oct 15, 2024
1 parent 90f5ed6 commit c4a764f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/api/app/models/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +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
# mysql lock errors in delayed job handling... we need to retry
retries -= 1
retry if retries.positive?
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 c4a764f

Please sign in to comment.