Skip to content

Commit f4966f3

Browse files
committed
Fix logic for non-retrying rename
1 parent 71692ea commit f4966f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

file/helper_common.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ func WithRenameRetries(duration, interval time.Duration) RotateOpt {
3838
}
3939

4040
func rename(src, dst string, options rotateOpts) error {
41-
if options.renameRetryDuration == 0 && options.renameRetryInterval == 0 {
41+
// Perform a regular (non-retrying) rename unless all retry options are specified.
42+
if options.renameRetryDuration == 0 || options.renameRetryInterval == 0 {
4243
return os.Rename(src, dst)
4344
}
4445

0 commit comments

Comments
 (0)