mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-05 04:58:33 +02:00
Use the transfer context also for the progress bars
This commit is contained in:
parent
3b545a0fd6
commit
adfe3f5771
2 changed files with 14 additions and 6 deletions
|
@ -18,6 +18,7 @@ Scotty. If not, see <https://www.gnu.org/licenses/>.
|
|||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -39,9 +40,10 @@ type progressBarUpdater struct {
|
|||
importedItems int
|
||||
}
|
||||
|
||||
func setupProgressBars(updateChan chan models.TransferProgress) progressBarUpdater {
|
||||
func setupProgressBars(ctx context.Context, updateChan chan models.TransferProgress) progressBarUpdater {
|
||||
wg := &sync.WaitGroup{}
|
||||
p := mpb.New(
|
||||
p := mpb.NewWithContext(
|
||||
ctx,
|
||||
mpb.WithWaitGroup(wg),
|
||||
mpb.WithOutput(color.Output),
|
||||
// mpb.WithWidth(64),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue