7 Commits

Author SHA1 Message Date
Georges-Antoine Assi
3c4113f8a8
Merge branch 'master' into flashpoint-metadata-handler 2025-09-11 21:27:48 -04:00
Michael Manganiello
e4e3928d1b
misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Michael Manganiello
a31a8504c2
feat: Add scheduled task to sync RetroAchievements progress
Add a new scheduled task that syncs RetroAchievements progress for all
users with a RetroAchievements username.

Environment variables:
- `ENABLE_SCHEDULED_RETROACHIEVEMENTS_PROGRESS_SYNC`: Enable or disable
  the task (default: `false`)
- `SCHEDULED_RETROACHIEVEMENTS_PROGRESS_SYNC_CRON`: Cron string to
  schedule the task (default: "0 4 * * *" - daily at 4 AM)
2025-08-31 01:57:26 -03:00
Georges-Antoine Assi
b7d59d74c4
init task 2025-08-27 22:25:45 -04:00
Georges-Antoine Assi
ef2546ec08
fix base handler filename 2025-08-27 12:40:16 -04:00
Michael Manganiello
80291f4be1
misc: Move cache initialization to startup script
Guarantee that cache is initialized during startup, and only once,
instead of every time a `MetadataHandler` object is instantiated.

Also, improve logic to determine `fixtures` paths.
2025-08-13 12:26:15 -03:00
Michael Manganiello
63f84b78d5
misc: Create startup script to run initial tasks before main application
For steps that need to run before the web application starts, such as
scheduling tasks, this new `startup.py` script is introduced.

This fixes a recently introduced issue where task scheduling was not
being triggered, because of it being included in the
`if __name__ == "__main__":` block, which is not executed when
the application is run by Gunicorn in production environments.

We do not include this logic as part of FastAPI's lifespan
implementation, as running multiple workers with Gunicorn would
cause this logic to be executed multiple times.
2025-08-12 23:14:26 -03:00