mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
jellyseerr: fix extremely long import, run only once
cache was being invalidated for every user, and on my 5000 user test instance, this sweated jellyseerr and my computer (audibly). Also, since this only needs to realistically run once, a flag is set in the database to indicate it's been done, and unset once the feature is disabled. It'll only run on boot if the flag is unset, or if triggered by the /tasks route. Will likely add manual trigger buttons on the web as well.
This commit is contained in:
@@ -22,6 +22,7 @@ func runMigrations(app *appContext) {
|
||||
// migrateHyphens(app)
|
||||
migrateToBadger(app)
|
||||
intialiseCustomContent(app)
|
||||
migrateJellyseerrImportDaemon(app)
|
||||
}
|
||||
|
||||
// Migrate pre-0.2.0 user templates to profiles
|
||||
@@ -505,3 +506,11 @@ func migrateExternalURL(app *appContext) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Migrate from use of "Import Existing Users" Jellyseerr import daemon to one-time run when enabling the feature.
|
||||
func migrateJellyseerrImportDaemon(app *appContext) {
|
||||
// When Jellyseerr is disabled, set this flag to false so that an initial sync happens the next time it is enabled.
|
||||
if !(app.config.Section("jellyseerr").Key("enabled").MustBool(false)) {
|
||||
app.storage.db.Upsert("jellyseerr_inital_sync_status", JellyseerrInitialSyncStatus{false})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user