Skip to content

Commit 407ff7b

Browse files
committed
Start with fresh database if there are errors in decompression
1 parent eae79d3 commit 407ff7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/dump_restbase.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ function dumpWiki(options) {
2626
// If a dump exists, uncompress it & use it as a starting point
2727
var dumpPromise = P.resolve();
2828
if (fs.existsSync(dumpDB)) {
29-
dumpPromise = proc.execFileAsync('pixz', ['-d', dumpDB, workDB]);
29+
dumpPromise = proc.execFileAsync('pixz', ['-d', dumpDB, workDB])
30+
.catch(function() {
31+
return fs.unlinkAsync(workDB);
32+
});
3033
}
3134

3235
return dumpPromise
@@ -53,7 +56,7 @@ function dumpWiki(options) {
5356
return fs.unlinkAsync(workDB);
5457
})
5558
.catch(function(e) {
56-
console.error(e);
59+
console.error(domain, e);
5760
});
5861
}
5962

0 commit comments

Comments
 (0)