diff --git a/src/janitor.js b/src/janitor.js index 2802e11b0..2f0ca9994 100644 --- a/src/janitor.js +++ b/src/janitor.js @@ -12,6 +12,8 @@ exports = module.exports = { cleanupDockerVolumes: cleanupDockerVolumes }; +var NOOP_CALLBACK = function () { }; + function ignoreError(func) { return function (callback) { func(function (error) { @@ -83,6 +85,8 @@ function cleanupTmpVolume(containerInfo, callback) { function cleanupDockerVolumes(callback) { assert(!callback || typeof callback === 'function'); // callback is null when called from cronjob + callback = callback || NOOP_CALLBACK; + debug('Cleaning up docker volumes'); docker.listContainers(function (error, containers) {