diff --git a/services/spelling/app/coffee/ASpellWorkerPool.coffee b/services/spelling/app/coffee/ASpellWorkerPool.coffee index 84ad211ff9..f4e1a637f5 100644 --- a/services/spelling/app/coffee/ASpellWorkerPool.coffee +++ b/services/spelling/app/coffee/ASpellWorkerPool.coffee @@ -54,10 +54,11 @@ class ASpellWorkerPool worker.check words, (err, output) => clearTimeout killTimer callback(err, output) - # queue a shutdown if worker is not used + return if err? # process has shut down if worker.count > @MAX_REQUESTS worker.shutdown("reached limit of " + @MAX_REQUESTS + " requests") else + # queue a shutdown if worker is idle worker.idleTimer = setTimeout () -> worker.shutdown("idle worker") worker.idleTimer = null