From 765a11f135460f31881d1504ac36878b63b0b3e2 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 29 Oct 2022 17:37:56 -0500 Subject: [PATCH] Update:Increase db lockfile stale time to 2 mins #1095 --- server/Db.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/server/Db.js b/server/Db.js index de5c274a..bc88ca3e 100644 --- a/server/Db.js +++ b/server/Db.js @@ -24,15 +24,16 @@ class Db { this.SeriesPath = Path.join(global.ConfigPath, 'series') this.FeedsPath = Path.join(global.ConfigPath, 'feeds') - this.libraryItemsDb = new njodb.Database(this.LibraryItemsPath) - this.usersDb = new njodb.Database(this.UsersPath) - this.sessionsDb = new njodb.Database(this.SessionsPath) - this.librariesDb = new njodb.Database(this.LibrariesPath, { datastores: 2 }) - this.settingsDb = new njodb.Database(this.SettingsPath, { datastores: 2 }) - this.collectionsDb = new njodb.Database(this.CollectionsPath, { datastores: 2 }) - this.authorsDb = new njodb.Database(this.AuthorsPath) - this.seriesDb = new njodb.Database(this.SeriesPath, { datastores: 2 }) - this.feedsDb = new njodb.Database(this.FeedsPath, { datastores: 2 }) + const staleTime = 1000 * 60 * 2 + this.libraryItemsDb = new njodb.Database(this.LibraryItemsPath, { lockoptions: { stale: staleTime } }) + this.usersDb = new njodb.Database(this.UsersPath, { lockoptions: { stale: staleTime } }) + this.sessionsDb = new njodb.Database(this.SessionsPath, { lockoptions: { stale: staleTime } }) + this.librariesDb = new njodb.Database(this.LibrariesPath, { datastores: 2, lockoptions: { stale: staleTime } }) + this.settingsDb = new njodb.Database(this.SettingsPath, { datastores: 2, lockoptions: { stale: staleTime } }) + this.collectionsDb = new njodb.Database(this.CollectionsPath, { datastores: 2, lockoptions: { stale: staleTime } }) + this.authorsDb = new njodb.Database(this.AuthorsPath, { lockoptions: { stale: staleTime } }) + this.seriesDb = new njodb.Database(this.SeriesPath, { datastores: 2, lockoptions: { stale: staleTime } }) + this.feedsDb = new njodb.Database(this.FeedsPath, { datastores: 2, lockoptions: { stale: staleTime } }) this.libraryItems = [] this.users = []