π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Fix concurrent map writes in file copy
Neeraj Gupta266f374af93f
diff --git a/server/pkg/controller/file_copy/file_copy.go b/server/pkg/controller/file_copy/file_copy.goindex 0d718f4264..4c785dbd90 100644--- a/server/pkg/controller/file_copy/file_copy.go+++ b/server/pkg/controller/file_copy/file_copy.go@@ -139,6 +139,7 @@ func (fc *FileCopyController) CopyFiles(c *gin.Context, req ente.CopyFileSyncReqfileCopyList = append(fileCopyList, fileCopy)}oldToNewFileIDMap := make(map[int64]int64)+ var mapMutex sync.Mutexvar wg sync.WaitGrouperrChan := make(chan error, len(fileCopyList))@@ -151,7 +152,9 @@ func (fc *FileCopyController) CopyFiles(c *gin.Context, req ente.CopyFileSyncReqerrChan <- errreturn}+ mapMutex.Lock()oldToNewFileIDMap[fileCopy.SourceFile.ID] = newFile.ID+ mapMutex.Unlock()}(fileCopy)}