Explorar el Código

don't let error events overwrite exit event

(not sure if this can happen but it would be bad if it did)
Brian Gough hace 11 años
padre
commit
3bbd0d49a9
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      services/spelling/app/coffee/ASpellWorker.coffee

+ 2 - 2
services/spelling/app/coffee/ASpellWorker.coffee

@@ -16,12 +16,12 @@ class ASpellWorker
 			logger.log process: @pipe.pid, lang: @language, "aspell worker has exited"
 			metrics.inc "aspellWorker-exit-" + @language
 		@pipe.on 'error', (err) =>
-			@state = 'error'
+			@state = 'error' unless @state == 'killed'
 			logger.log process: @pipe.pid, error: err, stdout: output, stderr: error, lang: @language, "aspell worker error"
 			if @callback?
 				@callback err, []
 		@pipe.stdin.on 'error', (err) =>
-			@state = 'error'
+			@state = 'error' unless @state == 'killed'
 			logger.log process: @pipe.pid, error: err, stdout: output, stderr: error, lang: @language, "aspell worker error on stdin"
 			if @callback?
 				@callback err, []