Print certain log messages once per error (#17484)

This commit is contained in:
Kaan Kabalak
2023-06-24 20:29:13 -07:00
committed by GitHub
parent 1f8b9b4bd5
commit 21fbe88e1f
15 changed files with 31 additions and 31 deletions

View File

@@ -2164,10 +2164,10 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, f
}
if err != nil && !IsErr(err, ignoredErrs...) && !contextCanceled(ctx) {
// Only log these errors if context is not yet canceled.
logger.LogIf(ctx, fmt.Errorf("srcVolume: %s, srcPath: %s, dstVolume: %s:, dstPath: %s - error %v",
logger.LogOnceIf(ctx, fmt.Errorf("srcVolume: %s, srcPath: %s, dstVolume: %s:, dstPath: %s - error %v",
srcVolume, srcPath,
dstVolume, dstPath,
err))
err), "xl-storage-rename-data"+srcVolume+dstVolume)
}
if err == nil && s.globalSync {
globalSync()