fix: protect ReplicationStats against concurrent map iteration and write crash (#17403)

This commit is contained in:
Klaus Post
2023-06-12 09:17:11 -07:00
committed by GitHub
parent bb24346e04
commit 6f2406b0b6
2 changed files with 37 additions and 7 deletions

View File

@@ -373,7 +373,7 @@ func (f *folderScanner) sendUpdate() {
}
if flat := f.updateCache.sizeRecursive(f.newCache.Info.Name); flat != nil {
select {
case f.updates <- *flat:
case f.updates <- flat.clone():
default:
}
f.lastUpdate = time.Now()