Stop the process when expire-channels is done
This commit is contained in:
@@ -418,6 +418,7 @@ module.exports.create = function (
|
||||
openFileLimit: conf.openFileLimit || 2048,
|
||||
};
|
||||
// 0x1ff -> 777
|
||||
var it;
|
||||
Fs.mkdir(env.root, 0x1ff, function (err) {
|
||||
if (err && err.code !== 'EEXIST') {
|
||||
// TODO: somehow return a nice error
|
||||
@@ -465,9 +466,12 @@ module.exports.create = function (
|
||||
if (!isValidChannelId(channelName)) { return void cb(new Error('EINVAL')); }
|
||||
clearChannel(env, channelName, cb);
|
||||
},
|
||||
shutdown: function () {
|
||||
clearInterval(it);
|
||||
}
|
||||
});
|
||||
});
|
||||
setInterval(function () {
|
||||
it = setInterval(function () {
|
||||
flushUnusedChannels(env, function () { });
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user