Explorar o 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 %!s(int64=11) %!d(string=hai) anos
pai
achega
3bbd0d49a9
Modificáronse 1 ficheiros con 2 adicións e 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, []