1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

more ticker improvements

This commit is contained in:
Jesse Duffield
2020-02-01 12:23:56 +11:00
parent c173ebf5b9
commit df050472a1
3 changed files with 9 additions and 3 deletions

View File

@ -788,9 +788,11 @@ func (gui *Gui) renderGlobalOptions() error {
func (gui *Gui) goEvery(interval time.Duration, stop chan struct{}, function func() error) {
go func() {
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
select {
case <-time.Tick(interval):
case <-ticker.C:
_ = function()
case <-stop:
return