The interval of the Ticker does not seem to update when the spinner is changed

#6 · closed · 3 comments

View on GitHub ↗

Ullaakut

```go func (w *Wow) Start() { if !w.running { ctx, done := context.WithCancel(context.Background()) t := time.NewTicker(time.Duration(w.s.Interval) * time.Millisecond) ``` Here the ticker is set the first time we call the `Start()` method, with the interval of the current Spinner. When the spinner is changed, this interval is not updated. I discovered this when trying to make my manual way of erasing the output faster by doing this: ```go w.Text("\b").Spinner(spin.Spinner{Frames: []string{""}, Interval: 1}) time.Sleep(2 * time.Millisecond) w.Stop() ``` Here, the spinner still waits for 80ms until it checks what it has to print, even though I set it to an interval of 1 millisecond.

Comments

gernest

You are correct, I will take a look at this when I get time.

Ullaakut

I don't think you wanted to close the issue though, until it's fixed :-) You'll forget about it otherwise, and this one is pretty important imo.

gernest

@Ullaakut I fixed this, please update the package and check again. This was automatically closed by the fixing commit. Let me know if it is not working.