mirror of
https://github.com/restic/restic.git
synced 2025-12-03 21:51:47 +00:00
archiver: remove unused fileInfo from progress callback
This commit is contained in:
@@ -3,7 +3,6 @@ package backup
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"os"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
@@ -79,7 +78,7 @@ func (b *JSONProgress) Update(total, processed Counter, errors uint, currentFile
|
||||
|
||||
// ScannerError is the error callback function for the scanner, it prints the
|
||||
// error in verbose mode and returns nil.
|
||||
func (b *JSONProgress) ScannerError(item string, fi os.FileInfo, err error) error {
|
||||
func (b *JSONProgress) ScannerError(item string, err error) error {
|
||||
b.error(errorUpdate{
|
||||
MessageType: "error",
|
||||
Error: err,
|
||||
@@ -90,7 +89,7 @@ func (b *JSONProgress) ScannerError(item string, fi os.FileInfo, err error) erro
|
||||
}
|
||||
|
||||
// Error is the error callback function for the archiver, it prints the error and returns nil.
|
||||
func (b *JSONProgress) Error(item string, fi os.FileInfo, err error) error {
|
||||
func (b *JSONProgress) Error(item string, err error) error {
|
||||
b.error(errorUpdate{
|
||||
MessageType: "error",
|
||||
Error: err,
|
||||
|
||||
@@ -3,7 +3,6 @@ package backup
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -14,8 +13,8 @@ import (
|
||||
|
||||
type ProgressPrinter interface {
|
||||
Update(total, processed Counter, errors uint, currentFiles map[string]struct{}, start time.Time, secs uint64)
|
||||
Error(item string, fi os.FileInfo, err error) error
|
||||
ScannerError(item string, fi os.FileInfo, err error) error
|
||||
Error(item string, err error) error
|
||||
ScannerError(item string, err error) error
|
||||
CompleteItem(messageType string, item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration)
|
||||
ReportTotal(item string, start time.Time, s archiver.ScanStats)
|
||||
Finish(snapshotID restic.ID, start time.Time, summary *Summary, dryRun bool)
|
||||
@@ -44,11 +43,11 @@ type ProgressReporter interface {
|
||||
CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration)
|
||||
StartFile(filename string)
|
||||
CompleteBlob(filename string, bytes uint64)
|
||||
ScannerError(item string, fi os.FileInfo, err error) error
|
||||
ScannerError(item string, err error) error
|
||||
ReportTotal(item string, s archiver.ScanStats)
|
||||
SetMinUpdatePause(d time.Duration)
|
||||
Run(ctx context.Context) error
|
||||
Error(item string, fi os.FileInfo, err error) error
|
||||
Error(item string, err error) error
|
||||
Finish(snapshotID restic.ID)
|
||||
}
|
||||
|
||||
@@ -173,13 +172,13 @@ func (p *Progress) Run(ctx context.Context) error {
|
||||
|
||||
// ScannerError is the error callback function for the scanner, it prints the
|
||||
// error in verbose mode and returns nil.
|
||||
func (p *Progress) ScannerError(item string, fi os.FileInfo, err error) error {
|
||||
return p.printer.ScannerError(item, fi, err)
|
||||
func (p *Progress) ScannerError(item string, err error) error {
|
||||
return p.printer.ScannerError(item, err)
|
||||
}
|
||||
|
||||
// Error is the error callback function for the archiver, it prints the error and returns nil.
|
||||
func (p *Progress) Error(item string, fi os.FileInfo, err error) error {
|
||||
cbErr := p.printer.Error(item, fi, err)
|
||||
func (p *Progress) Error(item string, err error) error {
|
||||
cbErr := p.printer.Error(item, err)
|
||||
|
||||
select {
|
||||
case p.errCh <- struct{}{}:
|
||||
|
||||
@@ -2,7 +2,6 @@ package backup
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
@@ -75,13 +74,13 @@ func (b *TextProgress) Update(total, processed Counter, errors uint, currentFile
|
||||
|
||||
// ScannerError is the error callback function for the scanner, it prints the
|
||||
// error in verbose mode and returns nil.
|
||||
func (b *TextProgress) ScannerError(item string, fi os.FileInfo, err error) error {
|
||||
func (b *TextProgress) ScannerError(item string, err error) error {
|
||||
b.V("scan: %v\n", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Error is the error callback function for the archiver, it prints the error and returns nil.
|
||||
func (b *TextProgress) Error(item string, fi os.FileInfo, err error) error {
|
||||
func (b *TextProgress) Error(item string, err error) error {
|
||||
b.E("error: %v\n", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user