HMS-5202: don't always rerun failed snaps #928
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
After some investigation it was discovered that currently all failed snapshots are being re-run every hour. This results in no 'extra' repos being synced. This change results in failed snapshots only being re-run every day.
This also fixes a couple of things, such as sorting by finished_at (instead of queued_at), and re-snapshotting every 25 hours instead of 24 (need to subtract one from the query)
Testing steps
https://fixtures.pulpproject.org/rpm-unsigned/
https://jlsherrill.fedorapeople.org/fake-repos/needed-errata/
https://redhat.com/notarepo
go run cmd/external-repos/main.go nightly-jobs 24
for consistentcy do not re-run it until snapshots are done
everytime you run it, you'll see one snapshot get run and its always the same one, the one that failed
go run cmd/external-repos/main.go nightly-jobs 24
on this PR,now everytime you run it, you'll get a different one of the repos which should alternate between all 3:
i added some logging to make this easier to see:
enqueued snapshot for repository config 147df40e-e1be-40a5-bcb2-726b6e63818c