Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Commit

Permalink
worker: panic if recycle a nil worker
Browse files Browse the repository at this point in the history
  • Loading branch information
lonng committed Jan 18, 2019
1 parent c749958 commit 1ad16a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lightning/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func (pool *RestoreWorkerPool) Apply() *RestoreWorker {
}

func (pool *RestoreWorkerPool) Recycle(worker *RestoreWorker) {
if worker == nil {
panic("invalid restore worker")
}
pool.workers <- worker
metric.IdleWorkersGauge.WithLabelValues(pool.name).Set(float64(len(pool.workers)))
}
Expand Down

0 comments on commit 1ad16a0

Please sign in to comment.