mirror of
https://github.com/restic/restic.git
synced 2024-12-24 16:54:00 +00:00
ui: cleanup backup status shutdown
This commit is contained in:
parent
c2ef049f1b
commit
13ce981794
1 changed files with 1 additions and 6 deletions
|
@ -40,7 +40,6 @@ type Backup struct {
|
||||||
processedCh chan counter
|
processedCh chan counter
|
||||||
errCh chan struct{}
|
errCh chan struct{}
|
||||||
workerCh chan fileWorkerMessage
|
workerCh chan fileWorkerMessage
|
||||||
finished chan struct{}
|
|
||||||
closed chan struct{}
|
closed chan struct{}
|
||||||
|
|
||||||
summary struct {
|
summary struct {
|
||||||
|
@ -71,7 +70,6 @@ func NewBackup(term *termstatus.Terminal, verbosity uint) *Backup {
|
||||||
processedCh: make(chan counter),
|
processedCh: make(chan counter),
|
||||||
errCh: make(chan struct{}),
|
errCh: make(chan struct{}),
|
||||||
workerCh: make(chan fileWorkerMessage),
|
workerCh: make(chan fileWorkerMessage),
|
||||||
finished: make(chan struct{}),
|
|
||||||
closed: make(chan struct{}),
|
closed: make(chan struct{}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,9 +96,6 @@ func (b *Backup) Run(ctx context.Context) error {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return nil
|
return nil
|
||||||
case <-b.finished:
|
|
||||||
started = false
|
|
||||||
b.term.SetStatus([]string{""})
|
|
||||||
case t, ok := <-b.totalCh:
|
case t, ok := <-b.totalCh:
|
||||||
if ok {
|
if ok {
|
||||||
total = t
|
total = t
|
||||||
|
@ -374,8 +369,8 @@ func (b *Backup) ReportTotal(item string, s archiver.ScanStats) {
|
||||||
|
|
||||||
// Finish prints the finishing messages.
|
// Finish prints the finishing messages.
|
||||||
func (b *Backup) Finish(snapshotID restic.ID) {
|
func (b *Backup) Finish(snapshotID restic.ID) {
|
||||||
|
// wait for the status update goroutine to shut down
|
||||||
select {
|
select {
|
||||||
case b.finished <- struct{}{}:
|
|
||||||
case <-b.closed:
|
case <-b.closed:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue