mirror of
https://github.com/restic/restic.git
synced 2026-10-14 22:07:12 +00:00
Add success callback to the backend
This commit is contained in:
1 parent
baf58fbaa8
commit
be6baaec12
3 files changed
+33
-20
No files matched your search
@@ -439,9 +439,13 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
be = backend.NewRetryBackend(be, 10, func(msg string, err error, d time.Duration) {
|
||||
report := func(msg string, err error, d time.Duration) {
|
||||
Warnf("%v returned error, retrying after %v: %v\n", msg, d, err)
|
||||
})
|
||||
}
|
||||
success := func(msg string, retries int) {
|
||||
Warnf("%v operation successful after %d retries\n", msg, retries)
|
||||
}
|
||||
be = backend.NewRetryBackend(be, 10, report, success)
|
||||
|
||||
// wrap backend if a test specified a hook
|
||||
if opts.backendTestHook != nil {
|
||||
|
||||
Reference in new issue
Block a user