theckman / yacspin

Yet Another CLi Spinner; providing over 80 easy to use and customizable terminal spinners for multiple OSes
Apache License 2.0
434 stars 13 forks source link

Do not reset timer when painting a data update; fix races #18

Closed theckman closed 4 years ago

theckman commented 4 years ago

Without this change, updates of data reset the timer making the animation no longer render smoothly.

This also fixes some potential race conditions with Start() or Stop() and any of the setter methods.

codecov[bot] commented 4 years ago

Codecov Report

Merging #18 into master will increase coverage by 0.11%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage   91.94%   92.05%   +0.11%     
==========================================
  Files           2        2              
  Lines         335      340       +5     
==========================================
+ Hits          308      313       +5     
  Misses         14       14              
  Partials       13       13              
Impacted Files Coverage Δ
spinner.go 91.76% <100.00%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 26cc274...afc8adb. Read the comment docs.