fix(bitswap) stop the ticker when the run loop exits

@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow 2014-11-19 23:34:14 -08:00 committed by Jeromy
parent 11f2856d31
commit a5754a5ff4

View File

@ -170,6 +170,7 @@ func (bs *bitswap) run(ctx context.Context) {
rebroadcastTime := time.Second * 5
broadcastSignal := time.NewTicker(bs.strategy.GetRebroadcastDelay())
defer broadcastSignal.Stop()
for {
select {