Skip to content
Snippets Groups Projects
Commit d86d575c authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

for the JSON database 'engine', don't write database at close. This was...

for the JSON database 'engine', don't write database at close.  This was causing browserid to stomp changes made be dbwriter during tests where server restart occurs (like bcrypt password update test) - *really* closes issue #557
parent 66bcc87e
No related branches found
No related tags found
No related merge requests found
......@@ -106,12 +106,13 @@ exports.open = function(cfg, cb) {
};
exports.closeAndRemove = function(cb) {
flush();
fs.unlink(dbPath, function(err) { cb(err === null ? undefined : err); });
};
exports.close = function(cb) {
flush();
// don't flush database here to disk, the database is flushed synchronously when
// written - If we were to flush here we could overwrite changes made by
// another process - see issue #557
setTimeout(function() { cb(undefined) }, 0);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment