Commit 90d665fb authored by Brian Tiger Chow's avatar Brian Tiger Chow

fix(blockservice/worker) replace time.Tick with a timer we can stop

parent 686220bf
......@@ -84,6 +84,8 @@ func (w *Worker) start(c Config) {
defer close(workerChan)
var workQueue BlockList
debugInfo := time.NewTicker(5 * time.Second)
defer debugInfo.Stop()
for {
// take advantage of the fact that sending on nil channel always
......@@ -99,7 +101,7 @@ func (w *Worker) start(c Config) {
// if worker is ready and there's a block to process, send the
// block
case sendToWorker <- nextBlock:
case <-time.Tick(5 * time.Second):
case <-debugInfo.C:
if workQueue.Len() > 0 {
log.Debugf("%d blocks in blockservice provide queue...", workQueue.Len())
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment