www

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

commit 5c6d9de4b8ce626817f3552433d9054520046f06
parent d3bc693dabf72c39aad84156f495f32b11334a7a
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  1 Aug 2006 23:32:18 +0000

Addresses #77, maintain database backups

Temporarily added in a check of the backup file on startup, since I'm not entirely convinced that the backup mechanism on shutdown couldn't create a corrupt file under certain conditions

If you run with debug output on and notice the "Backup file was corrupt" message, let me know.


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/db.js | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/db.js b/chrome/chromeFiles/content/scholar/xpcom/db.js @@ -361,6 +361,18 @@ Scholar.DB = new function(){ var file = Scholar.getScholarDatabase(); var backupFile = Scholar.getScholarDatabase('bak'); + // DEBUG: Temporary check + // Test the backup file (to make sure the backup mechanism is working) + if (backupFile.exists()){ + try { + _connection = store.openDatabase(backupFile); + } + catch (e){ + Scholar.debug('Backup file was corrupt', 1); + } + _connection = undefined; + } + catchBlock: try { _connection = store.openDatabase(file); }