mirror of
https://github.com/restic/restic.git
synced 2026-10-08 03:17:12 +00:00
retry: explicitly log failed requests
This simplifies finding the request in the log output that cause an operation to fail.
This commit is contained in:
1 parent
8898f61717
commit
a3633cad9e
3 files changed
+45
-12
No files matched your search
@@ -416,7 +416,11 @@ func OpenRepository(ctx context.Context, opts GlobalOptions) (*repository.Reposi
|
||||
}
|
||||
|
||||
report := func(msg string, err error, d time.Duration) {
|
||||
Warnf("%v returned error, retrying after %v: %v\n", msg, d, err)
|
||||
if d >= 0 {
|
||||
Warnf("%v returned error, retrying after %v: %v\n", msg, d, err)
|
||||
} else {
|
||||
Warnf("%v failed: %v\n", msg, err)
|
||||
}
|
||||
}
|
||||
success := func(msg string, retries int) {
|
||||
Warnf("%v operation successful after %d retries\n", msg, retries)
|
||||
|
||||
Reference in new issue
Block a user