improve metrics of aspool

This commit is contained in:
Henry Oswald 2019-01-14 10:35:32 +00:00
parent 186f321391
commit f94deb2cf2

View file

@ -11,11 +11,11 @@ class ASpellWorker
@count = 0
@pipe = child_process.spawn("aspell", ["pipe", "-t", "--encoding=utf-8", "-d", language])
logger.info process: @pipe.pid, lang: @language, "starting new aspell worker"
metrics.inc "aspellWorker-start", 1, {method: @language}
metrics.inc "aspellWorker", 1, {status: "start", method: @language}
@pipe.on 'exit', () =>
@state = 'killed'
logger.info process: @pipe.pid, lang: @language, "aspell worker has exited"
metrics.inc "aspellWorker-exit" , 1, {method: @language}
metrics.inc "aspellWorker" , 1, {status: "exit", method: @language}
@pipe.on 'close', () =>
@state = 'closed' unless @state == 'killed'
if @callback?