Explorar el Código

don't run the idle shutdown timer if the process has errored

Brian Gough hace 11 años
padre
commit
c8103a4f35
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      services/spelling/app/coffee/ASpellWorkerPool.coffee

+ 2 - 1
services/spelling/app/coffee/ASpellWorkerPool.coffee

@@ -54,10 +54,11 @@ class ASpellWorkerPool
 		worker.check words, (err, output) =>
 		worker.check words, (err, output) =>
 			clearTimeout killTimer
 			clearTimeout killTimer
 			callback(err, output)
 			callback(err, output)
-			# queue a shutdown if worker is not used
+			return if err? # process has shut down
 			if worker.count > @MAX_REQUESTS
 			if worker.count > @MAX_REQUESTS
 				worker.shutdown("reached limit of " + @MAX_REQUESTS + " requests")
 				worker.shutdown("reached limit of " + @MAX_REQUESTS + " requests")
 			else
 			else
+				# queue a shutdown if worker is idle
 				worker.idleTimer = setTimeout () ->
 				worker.idleTimer = setTimeout () ->
 					worker.shutdown("idle worker")
 					worker.shutdown("idle worker")
 					worker.idleTimer = null
 					worker.idleTimer = null