stats: handle FatalError and NoRetryError when reported to stats

This commit is contained in:
Cédric Connes 2018-08-30 18:26:07 +02:00 committed by Nick Craig-Wood
parent e07a850be3
commit 1b95ca2852
2 changed files with 64 additions and 7 deletions

View file

@ -311,11 +311,11 @@ func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error) {
}
break
}
if fserrors.IsFatalError(err) {
if fserrors.IsFatalError(err) || accounting.Stats.HadFatalError() {
fs.Errorf(nil, "Fatal error received - not attempting retries")
break
}
if fserrors.IsNoRetryError(err) {
if fserrors.IsNoRetryError(err) || (accounting.Stats.Errored() && !accounting.Stats.HadRetryError()) {
fs.Errorf(nil, "Can't retry this error - not attempting retries")
break
}