Skip to content

Commit

Permalink
Fix: non-blocking ChannelTransferProgress handling
Browse files Browse the repository at this point in the history
  • Loading branch information
black-night-heron committed Apr 20, 2024
1 parent 82844da commit 8a92fc6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func cmdUpload(client *sdk.Client, renderer *OutputRenderer, args []string) {
for !done {
bytes := <-client.ChannelTransferProgress
renderer.updateProgressBar(bytes)
time.Sleep(50 * time.Millisecond)
}
}()
go func() {
Expand Down Expand Up @@ -189,7 +188,6 @@ func cmdDownload(client *sdk.Client, renderer *OutputRenderer, args []string) {
for !done {
bytes := <-client.ChannelTransferProgress
renderer.updateProgressBar(bytes)
time.Sleep(50 * time.Millisecond)
}
}()
go func() {
Expand Down
1 change: 1 addition & 0 deletions output-renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func (r *OutputRenderer) initProgressBar(maxBytes int64, desc string) {
progressbar.OptionOnCompletion(func() { fmt.Printf("\n") }),
progressbar.OptionSpinnerType(14),
progressbar.OptionSetRenderBlankState(true),
progressbar.OptionThrottle(50*time.Millisecond),
)
}

Expand Down

0 comments on commit 8a92fc6

Please sign in to comment.