-
Notifications
You must be signed in to change notification settings - Fork 34
Build: separate delete-snapshots from process-repos #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
deployments/deployment.yaml
Outdated
@@ -875,6 +875,87 @@ objects: | |||
name: content-sources-candlepin | |||
key: key | |||
optional: true | |||
- name: snapshot-cleanup | |||
schedule: "0 1 * * *" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to define a DAILY_CRON_JOB
value for this, kinda like weekly
deployments/deployment.yaml
Outdated
description: whether to not run the daily job to delete outdated snapshots | ||
required: false | ||
value: "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unused, and looks like the new job is using SUSPEND_CRON_JOB
instead. I'm guessing this can just be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops :) meant to update that value but yes just using the existing param is better!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Summary
Separates the snapshot-cleanup job from process-repos so it can be run on its own schedule (this sets it to run daily). This may also help narrow down and reduce the errors being reported by glitchtip (https://issues.redhat.com/browse/HMS-5947)
Testing steps
UPDATE snapshots SET created_at = (NOW() - CAST('365 days' AS INTERVAL)) WHERE uuid = '<snapshot_uuid>';
go run cmd/external-repos/main.go process-repos
. You shouldn't see any delete-snapshots tasks enqueuedgo run cmd/external-repos/main.go snapshot-cleanup
. This should start the delete-snapshots task