From 3c1aadd6c13b81984412d17aa06194a20b1002d0 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 22 Aug 2019 11:49:43 +0200 Subject: [PATCH] archive metadata even if there is no corresponding channel log --- storage/file.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/storage/file.js b/storage/file.js index def17e622..75dabf5b7 100644 --- a/storage/file.js +++ b/storage/file.js @@ -481,9 +481,13 @@ var archiveChannel = function (env, channelName, cb) { nThen(function (w) { // move the channel log and abort if anything goes wrong Fse.move(currentPath, archivePath, { overwrite: true }, w(function (err) { - if (!err) { return; } - w.abort(); - cb(err); + 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(); + return void cb(err); + } })); }).nThen(function (w) { // archive the dedicated metadata channel