Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Snapshot v6.2.3 regression #251

Merged
merged 15 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ TODO
.vscode
build
npm-shrinkwrap.json.bak
test/testdb
13 changes: 8 additions & 5 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ Database.prototype.initialize = function(callback) {
if (err) {
return callback(err);
}
levelup(
self.options.db || encode(cachedown(directory, filedown).maxSize(100)),
{ valueEncoding: "json" },
finishInitializing
);
const levelupOptions = { valueEncoding: "json" };
if (self.options.db) {
const store = self.options.db;
levelup(store, levelupOptions, finishInitializing);
} else {
const store = encode(cachedown(directory, filedown).maxSize(100), levelupOptions);
levelup(store, {}, finishInitializing);
}
});

function finishInitializing(err, db) {
Expand Down
Loading