From 16447e031398fda8c2ed9a5aba29c367c4bafea9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 16 Feb 2018 17:28:22 +0100 Subject: [PATCH] Stop expiration code if no directories for tasks --- expire-channels.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/expire-channels.js b/expire-channels.js index a37a4677b..4e22dfce4 100644 --- a/expire-channels.js +++ b/expire-channels.js @@ -72,6 +72,10 @@ nt = nThen(function (w) { Fs.readdir(root, w(function (e, list) { if (e) { throw e; } dirs = list; + if (dirs.length === 0) { + w.abort(); + return; + } })); }).nThen(function (waitFor) { FileStorage.create(config, waitFor(function (_store) {