Skip to content

Commit

Permalink
Merge pull request #36 from black-night-heron/fix/non-blocking-receiv…
Browse files Browse the repository at this point in the history
…ing-progress

Fix: non-blocking ChannelTransferProgress handling
  • Loading branch information
virtualzone authored Apr 25, 2024
2 parents 82844da + 8a92fc6 commit 8c7d6bf
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 8c7d6bf

Please sign in to comment.