www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 13729495235260c4cb17d93071c8825d157fa003
parent b590c43edbf1c32d62cf7cdbbb78d0a6817732a6
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 19 Jun 2017 00:49:34 -0400

Don't initialize DB backup idle observer until after schema init

Diffstat:
Mchrome/content/zotero/xpcom/db.js | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js @@ -1302,11 +1302,13 @@ Zotero.DBConnection.prototype._getConnectionAsync = Zotero.Promise.coroutine(fun // Enable foreign key checks yield this.queryAsync("PRAGMA foreign_keys=true"); - // Register idle and shutdown handlers to call this.observe() for DB backup - var idleService = Components.classes["@mozilla.org/widget/idleservice;1"] + // Register idle observer for DB backup + Zotero.Schema.schemaUpdatePromise.then(() => { + Zotero.debug("Initializing DB backup idle observer"); + var idleService = Components.classes["@mozilla.org/widget/idleservice;1"] .getService(Components.interfaces.nsIIdleService); - idleService.addIdleObserver(this, 60); - idleService = null; + idleService.addIdleObserver(this, 300); + }); return this._connection; });