mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 00:21:04 +00:00
Merge pull request #191 from CallanTaylor/stop-ticker
Defer stop ticker
This commit is contained in:
commit
14f27e86c8
1 changed files with 1 additions and 0 deletions
|
|
@ -118,6 +118,7 @@ func (t *TaskManager) NewTickerTask(duration time.Duration, before func(stop cha
|
||||||
before(stop)
|
before(stop)
|
||||||
}
|
}
|
||||||
tickChan := time.NewTicker(duration)
|
tickChan := time.NewTicker(duration)
|
||||||
|
defer tickChan.Stop()
|
||||||
// calling f first so that we're not waiting for the first tick
|
// calling f first so that we're not waiting for the first tick
|
||||||
f(stop, notifyStopped)
|
f(stop, notifyStopped)
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue