diff --git a/app/js/DockerRunner.js b/app/js/DockerRunner.js index 33000d7..e355f95 100644 --- a/app/js/DockerRunner.js +++ b/app/js/DockerRunner.js @@ -137,12 +137,7 @@ const DockerRunner = { }, _runAndWaitForContainer(options, volumes, timeout, _callback) { - const callback = function (...args) { - _callback(...args) - // Only call the callback once - _callback = function () {} - } - + const callback = _.once(_callback) const { name } = options let streamEnded = false @@ -463,11 +458,7 @@ const DockerRunner = { }, waitForContainer(containerId, timeout, _callback) { - const callback = function (...args) { - _callback(...args) - // Only call the callback once - _callback = function () {} - } + const callback = _.once(_callback) const container = dockerode.getContainer(containerId)