Skip to content

Commit

Permalink
Merge pull request #340 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 12.57.1
  • Loading branch information
andyone authored Jan 13, 2023
2 parents d8c6dc8 + f9c5b43 commit b32d88e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 12.57.1

* `[progress]` Fixed bug with updating progress settings

### 12.57.0

* `[log]` Added interface for compatible loggers
Expand Down
2 changes: 1 addition & 1 deletion ek.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "12.57.0"
const VERSION = "12.57.1"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
2 changes: 1 addition & 1 deletion progress/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func SimpleExample() {
pbs.RefreshRate = 50 * time.Millisecond
pbs.IsSize = false

// You can update all settings except RefreshRate before and after]
// You can update all settings except RefreshRate before and after
// calling Start method. RefreshRate must be set before calling
// Start method.
pb.UpdateSettings(pbs)
Expand Down
7 changes: 6 additions & 1 deletion progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,15 @@ func (b *Bar) Start() {
b.started = true
b.finished = false
b.startTime = time.Now()
b.ticker = time.NewTicker(b.settings.RefreshRate)
b.finishChan = make(chan bool)
b.finishGroup = sync.WaitGroup{}

if b.settings.RefreshRate >= time.Millisecond {
b.ticker = time.NewTicker(b.settings.RefreshRate)
} else {
b.ticker = time.NewTicker(100 * time.Millisecond)
}

if b.total > 0 {
b.passThruCalc = NewPassThruCalc(b.total, 10.0)
}
Expand Down
3 changes: 3 additions & 0 deletions progress/progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func (s *ProgressSuite) TestBar(c *C) {
pb.Finish() // should be skipped (not started)
c.Assert(pb.IsFinished(), Equals, false)

pbs.RefreshRate = 0
pb.UpdateSettings(pbs)

pb.Start()
pb.renderElements(false)

Expand Down

0 comments on commit b32d88e

Please sign in to comment.