🧵 Replace cache with thread-safe sync.Map
This commit is contained in:
@@ -81,7 +81,7 @@ func ReUploadFileToPermanent(meta models.Attachment) error {
|
||||
}
|
||||
|
||||
database.C.Save(&meta)
|
||||
metadataCache[meta.ID] = meta
|
||||
metadataCache.Store(meta.ID, meta)
|
||||
return nil
|
||||
case models.DestinationTypeS3:
|
||||
var destConfigured models.S3Destination
|
||||
@@ -105,7 +105,7 @@ func ReUploadFileToPermanent(meta models.Attachment) error {
|
||||
}
|
||||
|
||||
database.C.Save(&meta)
|
||||
metadataCache[meta.ID] = meta
|
||||
metadataCache.Store(meta.ID, meta)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid destination: unsupported protocol %s", dest.Type)
|
||||
|
Reference in New Issue
Block a user