archive metadata even if there is no corresponding channel log

pull/1/head
ansuz 5 years ago
parent 55ea7f13fd
commit 3c1aadd6c1

@ -481,9 +481,13 @@ var archiveChannel = function (env, channelName, cb) {
nThen(function (w) { nThen(function (w) {
// move the channel log and abort if anything goes wrong // move the channel log and abort if anything goes wrong
Fse.move(currentPath, archivePath, { overwrite: true }, w(function (err) { Fse.move(currentPath, archivePath, { overwrite: true }, w(function (err) {
if (!err) { return; } if (err) {
// proceed to the next block to remove metadata even if there's no channel
if (err.code === 'ENOENT') { return; }
// abort and callback for other types of errors
w.abort(); w.abort();
cb(err); return void cb(err);
}
})); }));
}).nThen(function (w) { }).nThen(function (w) {
// archive the dedicated metadata channel // archive the dedicated metadata channel

Loading…
Cancel
Save