From c8103a4f35e1b0dd75a6e9a833a37ebf2a90c422 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 12 Mar 2015 10:27:11 +0000 Subject: [PATCH] don't run the idle shutdown timer if the process has errored --- services/spelling/app/coffee/ASpellWorkerPool.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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