Skip to content

Commit

Permalink
ui: cleanup backup status shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelEischer committed Dec 29, 2020
1 parent c2ef049 commit 13ce981
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/ui/backup.go
Expand Up @@ -40,7 +40,6 @@ type Backup struct {
processedCh chan counter
errCh chan struct{}
workerCh chan fileWorkerMessage
finished chan struct{}
closed chan struct{}

summary struct {
Expand Down Expand Up @@ -71,7 +70,6 @@ func NewBackup(term *termstatus.Terminal, verbosity uint) *Backup {
processedCh: make(chan counter),
errCh: make(chan struct{}),
workerCh: make(chan fileWorkerMessage),
finished: make(chan struct{}),
closed: make(chan struct{}),
}
}
Expand All @@ -98,9 +96,6 @@ func (b *Backup) Run(ctx context.Context) error {
select {
case <-ctx.Done():
return nil
case <-b.finished:
started = false
b.term.SetStatus([]string{""})
case t, ok := <-b.totalCh:
if ok {
total = t
Expand Down Expand Up @@ -374,8 +369,8 @@ func (b *Backup) ReportTotal(item string, s archiver.ScanStats) {

// Finish prints the finishing messages.
func (b *Backup) Finish(snapshotID restic.ID) {
// wait for the status update goroutine to shut down
select {
case b.finished <- struct{}{}:
case <-b.closed:
}

Expand Down

0 comments on commit 13ce981

Please sign in to comment.