Closed garcipat closed 1 year ago
Nice catch, we have an async lock we can use instead. Just search for AsyncLock. Would you mind submitting a pr for this?
I will check that then. Also I'm not sure if the lock has to be added in more operations. Its only in Copy and Rename.
In the InMemoryFileStoreage also a Concurrent dictionary could be used. But I dont know if thats better becasue its less complex or if it makes it more consistent using the AsyncLock there as well.
I discovered that in the file storage a lock object is used but the methods are actually asynchroneous.
Would it make sense to switch to a semaphore slim there instead? see here https://github.com/FoundatioFx/Foundatio/blob/871be38c6b4b0ab19e86041f1f8714557428fbf8/src/Foundatio/Storage/FolderFileStorage.cs#L15