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:
@@ -516,11 +516,16 @@ func start(asDaemon, firstCall bool) {
|
||||
go app.userDaemon.run()
|
||||
defer app.userDaemon.Shutdown()
|
||||
|
||||
if app.config.Section("jellyseerr").Key("enabled").MustBool(false) && app.config.Section("jellyseerr").Key("import_existing").MustBool(false) {
|
||||
if app.config.Section("jellyseerr").Key("enabled").MustBool(false) {
|
||||
// import_existing_users setting is deprecated, now it'll run when jellyseerr is enabled, or when triggered manually.
|
||||
// jellyseerrDaemon = newJellyseerrDaemon(time.Duration(30*time.Second), app)
|
||||
app.jellyseerrDaemon = newJellyseerrDaemon(time.Duration(10*time.Minute), app)
|
||||
go app.jellyseerrDaemon.run()
|
||||
defer app.jellyseerrDaemon.Shutdown()
|
||||
app.jellyseerrDaemon = newJellyseerrDaemon(time.Duration(24*time.Hour), app)
|
||||
if app.jellyseerrDaemon != nil {
|
||||
go app.jellyseerrDaemon.run()
|
||||
// Run on startup
|
||||
go app.jellyseerrDaemon.Trigger()
|
||||
defer app.jellyseerrDaemon.Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
if app.config.Section("password_resets").Key("enabled").MustBool(false) && serverType == mediabrowser.JellyfinServer {
|
||||
|
||||
Reference in New Issue
Block a user