From 4178ae3b47f5b743f8b64e82c689321c94a74b9c Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 28 Oct 2025 20:46:45 -0700 Subject: [PATCH] refactor --- weed/replication/sink/azuresink/azure_sink.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weed/replication/sink/azuresink/azure_sink.go b/weed/replication/sink/azuresink/azure_sink.go index 894e9958e..76368a209 100644 --- a/weed/replication/sink/azuresink/azure_sink.go +++ b/weed/replication/sink/azuresink/azure_sink.go @@ -195,9 +195,8 @@ func (g *AzureSink) handleExistingBlob(appendBlobClient *appendblob.Client, key const clockSkewTolerance = int64(2) // seconds - allow small clock differences remoteMtime := props.LastModified.Unix() localMtime := entry.Attributes.Mtime - // Skip if remote is newer/same (within skew tolerance) and has content, OR both are zero-length. - if (remoteMtime >= localMtime-clockSkewTolerance && *props.ContentLength > 0) || - (remoteMtime >= localMtime-clockSkewTolerance && *props.ContentLength == 0 && totalSize == 0) { + // Skip if remote is newer/same (within skew tolerance) and has content, OR if both are zero-length. + if remoteMtime >= localMtime-clockSkewTolerance && ((*props.ContentLength > 0) || (*props.ContentLength == 0 && totalSize == 0)) { glog.V(2).Infof("skip overwriting %s/%s: remote is up-to-date (remote mtime: %d >= local mtime: %d, size: %d)", g.container, key, remoteMtime, localMtime, *props.ContentLength) return false, nil