mirror of
https://github.com/hibiken/asynq.git
synced 2025-10-26 11:16:12 +08:00
Include worker stats to ProcessState
This commit is contained in:
@@ -165,10 +165,10 @@ func (p *processor) exec() {
|
||||
p.requeue(msg)
|
||||
return
|
||||
case p.sema <- struct{}{}: // acquire token
|
||||
p.ps.IncrWorkerCount(1)
|
||||
p.ps.AddWorkerStats(msg, time.Now())
|
||||
go func() {
|
||||
defer func() {
|
||||
p.ps.IncrWorkerCount(-1)
|
||||
p.ps.DeleteWorkerStats(msg)
|
||||
<-p.sema /* release token */
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user