Skip to content

Commit 47d9a52

Browse files
committed
Rename compressed dump only after compression completed
1 parent 407ff7b commit 47d9a52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/dump_restbase.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ function dumpWiki(options) {
5050
console.log('Output from ', domain + ':', res[0], res[1]);
5151
}
5252
//console.log('xz compressing');
53-
return proc.execFileAsync('pixz', ['-2', workDB, dumpDB]);
53+
return proc.execFileAsync('pixz', ['-2', workDB, workDB + '.xz'])
54+
.then(function() {
55+
return fs.renameAsync(workDB + '.xz', dumpDB);
56+
});
5457
})
5558
.then(function() {
5659
return fs.unlinkAsync(workDB);

0 commit comments

Comments
 (0)