summaryrefslogtreecommitdiffstats
path: root/pkg/tasks/tasks.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-02-01 12:23:56 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-02-02 11:26:24 +1100
commitdf050472a1330dbaed8e4e85571db3300143f827 (patch)
tree92b8fa522bf302736324e9119efbd4717c137086 /pkg/tasks/tasks.go
parentc173ebf5b9b4c691e176ba8956aabada7b1b3562 (diff)
more ticker improvements
Diffstat (limited to 'pkg/tasks/tasks.go')
-rw-r--r--pkg/tasks/tasks.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/tasks/tasks.go b/pkg/tasks/tasks.go
index 2468ac958..e062b6181 100644
--- a/pkg/tasks/tasks.go
+++ b/pkg/tasks/tasks.go
@@ -78,8 +78,10 @@ func (m *ViewBufferManager) NewCmdTask(cmd *exec.Cmd, linesToRead int) func(chan
loaded := false
go func() {
+ ticker := time.NewTicker(time.Millisecond * 100)
+ defer ticker.Stop()
select {
- case <-time.Tick(time.Millisecond * 100):
+ case <-ticker.C:
if !loaded {
m.beforeStart()
m.writer.Write([]byte("loading..."))