-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
[feature] Customizable media cleaner schedule #2304
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daenney
approved these changes
Oct 30, 2023
docs/configuration/media.md
Outdated
# String. 24hr time of day formatted as hh:mm:ss. | ||
# Examples: ["14:30:00", "00:00:00", "04:00:00"] | ||
# Default: "00:00:00" (midnight). | ||
media-cleanup-from: "00:00:00" |
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 would remove the :ss
part. I think it's very unlikely anyone needs to control the start time down to the second.
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.
Good point! Changed here: fe1fe95
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request implements customizable start time + interval period for media cleanup jobs.
Adds
media-cleanup-from
andmedia-cleanup-every
config fields, which keep the current default values of00:00:00
(midnight) and86400000000000
or24h
(24 hours).These fields allow admins to run their cleanup at different times and rates. For example, say one wanted to run a cleanup every 3 days at 4.30am, one could set
media-cleanup-from
to04:30:00
andmedia-cleanup-every
to72h
.To make this work, instantiation of the cleaner has been pushed all the way back to the server process. This is a bit more complex, code-wise, but has the advantage of the scheduler not being run by default when just doing CLI commands and whatnot.
Still a draft because I want to add some documentation for this.closes #2212
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
go fmt ./...
andgolangci-lint run
.