fix(bitswap) stop the ticker when the run loop exits
@whyrusleeping License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Nov 19, 2014 at 23:34 UTC
a5754a5ff4d06a767b7f0049c19c9d9a4f0d4e99
1 file changed
+1
exchange/bitswap/bitswap.go
+1
@@ -170,6 +170,7 @@ func (bs *bitswap) run(ctx context.Context) {
170
rebroadcastTime := time.Second * 5
171
172
broadcastSignal := time.NewTicker(bs.strategy.GetRebroadcastDelay())
173
+ defer broadcastSignal.Stop()
174
175
for {
176
select {