mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Send worker idle waiting times to statsd
This commit is contained in:
parent
cab5509076
commit
773e17df66
1 changed files with 3 additions and 0 deletions
|
@ -3,6 +3,7 @@ logger = require('logger-sharelatex')
|
|||
Keys = require('./RedisKeyBuilder')
|
||||
redis = require('redis')
|
||||
UpdateManager = require('./UpdateManager')
|
||||
Metrics = require('./Metrics')
|
||||
|
||||
module.exports = WorkersManager =
|
||||
createWorker: () ->
|
||||
|
@ -13,7 +14,9 @@ module.exports = WorkersManager =
|
|||
worker = {
|
||||
client: client
|
||||
waitForAndProcessUpdate: (callback = (error) ->) ->
|
||||
timer = new Metrics.Timer "worker.waiting"
|
||||
worker.client.blpop "pending-updates-list", 0, (error, result) ->
|
||||
timer.done()
|
||||
return callback(error) if error?
|
||||
return callback() if !result?
|
||||
[list_name, doc_key] = result
|
||||
|
|
Loading…
Reference in a new issue