Sfoglia il codice sorgente

don't let error events overwrite exit event

(not sure if this can happen but it would be bad if it did)
Brian Gough 11 anni fa
parent
commit
3bbd0d49a9
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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, []