这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rck
Copy link

@rck rck commented Jan 6, 2017

This pull request contains 2 patches.

  • RefreshInterval was not considered because the default bar was already created before the user could set this public variable. Setting the variable and then calling Start() is now possible.
  • When a program exited before uiprogress had a change to render the output, it looked like bars did not finish. So far there was a workaround by sleeping, but this should not be necessary.

Regards, rck

rck added 2 commits January 6, 2017 19:27
This variable is public, but has no effect. All operations like AddBar()
are executed on the default progress bar (defaultProgress). This default
bar is created at initialization time (var defaultProgress = New()).
Therefore setting RefreshInterval and then calling Start() has no
effect, as the old default RefreshInterval was already used.

This is changed by initializing the default progress bar when it is
actually used.
If there where multiple progress bars (e.g., multiple go routines, one
per bar), it could happen that the last go routine finished and then
main finished before the last bar got updated. On the command line this
then looks like the last go routine failed because it never rendered the
"100%" state, even if it reached it. This fixes that by calling refresh
one last time on Stop().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant