Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
adreed-msft committed Sep 29, 2023
2 parents 822b0b7 + 77fcf6f commit a756368
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/syncComparator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
syncSkipReasonMissingHash = "the source lacks an associated hash; please upload with --put-md5"
syncSkipReasonSameHash = "the source has the same hash"
syncOverwriteReasonNewerHash = "the source has a differing hash"
syncOverwriteResaonNewerLMT = "the source is more recent than the destination"
syncOverwriteReasonNewerLMT = "the source is more recent than the destination"
syncStatusSkipped = "skipped"
syncStatusOverwritten = "overwritten"
)
Expand Down Expand Up @@ -89,6 +89,7 @@ func (f *syncDestinationComparator) processIfNecessary(destinationObject StoredO
defer delete(f.sourceIndex.indexMap, destinationObject.relativePath)

if f.disableComparison {
syncComparatorLog(sourceObjectInMap.relativePath, syncStatusOverwritten, syncOverwriteReasonNewerHash, false)
return f.copyTransferScheduler(sourceObjectInMap)
}

Expand Down Expand Up @@ -116,6 +117,9 @@ func (f *syncDestinationComparator) processIfNecessary(destinationObject StoredO
syncComparatorLog(sourceObjectInMap.relativePath, syncStatusOverwritten, syncOverwriteResaonNewerLMT, false)

Check failure on line 117 in cmd/syncComparator.go

View workflow job for this annotation

GitHub Actions / lint (1.18, ubuntu-latest)

undefined: syncOverwriteResaonNewerLMT (typecheck)

Check failure on line 117 in cmd/syncComparator.go

View workflow job for this annotation

GitHub Actions / lint (1.18, ubuntu-latest)

undefined: syncOverwriteResaonNewerLMT (typecheck)
return f.copyTransferScheduler(sourceObjectInMap)
}

// skip if dest is more recent
syncComparatorLog(sourceObjectInMap.relativePath, syncStatusSkipped, syncSkipReasonTime, false)
} else {
// purposefully ignore the error from destinationCleaner
// it's a tolerable error, since it just means some extra destination object might hang around a bit longer
Expand Down Expand Up @@ -165,6 +169,7 @@ func (f *syncSourceComparator) processIfNecessary(sourceObject StoredObject) err

// if destination is stale, schedule source for transfer
if f.disableComparison {
syncComparatorLog(sourceObject.relativePath, syncStatusOverwritten, syncOverwriteReasonNewerHash, false)
return f.copyTransferScheduler(sourceObject)
}

Expand All @@ -189,12 +194,12 @@ func (f *syncSourceComparator) processIfNecessary(sourceObject StoredObject) err
return nil
} else if sourceObject.isMoreRecentThan(destinationObjectInMap, f.preferSMBTime) {
// if destination is stale, schedule source
syncComparatorLog(sourceObject.relativePath, syncStatusOverwritten, syncOverwriteResaonNewerLMT, false)
syncComparatorLog(sourceObject.relativePath, syncStatusOverwritten, syncOverwriteReasonNewerLMT, false)
return f.copyTransferScheduler(sourceObject)
}

syncComparatorLog(sourceObject.relativePath, syncStatusSkipped, syncSkipReasonTime, false)
// skip if dest is more recent
syncComparatorLog(sourceObject.relativePath, syncStatusSkipped, syncSkipReasonTime, false)
return nil
}

Expand Down

0 comments on commit a756368

Please sign in to comment.