mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Defer stop ticker
This commit is contained in:
parent
450d163040
commit
58d1eef502
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