-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Scheduled tasks #357
Merged
Merged
Scheduled tasks #357
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
gantoine
force-pushed
the
scheduled-tasks
branch
from
September 4, 2023 00:34
b25b9f4
to
0c20c83
Compare
This was
linked to
issues
Oct 30, 2023
zurdi15
reviewed
Oct 30, 2023
zurdi15
approved these changes
Oct 31, 2023
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.
This PR adds https://github.com/rq/rq-scheduler, which allows us to scheduled async tasks that run in Redis at regular intervals. Jobs can be run at a specific time in the future, after a time delta, or at recurring internals using cron notation (docs).
It also adds watchdog which monitors the filesystem for events (files created/moved/deleted) and schedules a rescan of the platform (or entire library is a new platform was added).
Users can toggle jobs using these environment variables:
Filesystem watcher
The watcher will monitor the
/library/roms
folder for changes to the filesystem, such as files being added, moved or deleted. It will ignore certain events (like modifying the file content or metadata), and will skip default OS files (like.DS_Store
on mac).When a change is detected, a scan will be scheduled for sometime in the future (default 5 minutes). If other events are triggered between now and the time at which the scan starts, more platforms will be added to the scan list (or the scan may switch to a full scan). This is done to reduce the number of tasks scheduled when many big changes happen to the library (mass upload, new mount, etc.)
Scheduled rescan
Users can opt to enable scheduled rescans, and set the interval using cron notation. Not that the scan will not completely rescan every file, only catch those which have been added/updated.
Closes #274
Switch titleDB update
Support was added for Nintendo Switch ROMs with filenames using the titleid/programid format (e.g. 0100000000010000.xci). If a file under the
switch
folder matches the regex, the scanner will use the index to attempt to match it to a game. If a match is found, the IGDB handler will use the matched name as the search term.The associated task updates the
/fixtures/switch_titledb.json
file at a regular interval to support new game releases.Closes #350
MAME XML update
Support was also added for MAME arcade games with shortcode names (e.g.
actionhw.zip
-> ACTION HOLLYWOOD), and works in the same way as the titleid matcher (without the regex).The associated task updates the
/fixtures/mame.xml
file at a regular interval to support updates to the library. The xmltodict library was introduced to parse the XML file and transform it to JSON.Closes #369