mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 22:17:22 +01:00
fix disposed semaphores
This commit is contained in:
parent
a1573ad2c3
commit
5a4010cb8a
1 changed files with 39 additions and 9 deletions
|
|
@ -240,9 +240,19 @@ public class ServerFilesController : ControllerBase
|
|||
}
|
||||
finally
|
||||
{
|
||||
fileLock?.Release();
|
||||
fileLock?.Dispose();
|
||||
_fileUploadLocks.TryRemove(hash, out _);
|
||||
try
|
||||
{
|
||||
fileLock?.Release();
|
||||
fileLock?.Dispose();
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// it's disposed whatever
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fileUploadLocks.TryRemove(hash, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -327,9 +337,19 @@ public class ServerFilesController : ControllerBase
|
|||
}
|
||||
finally
|
||||
{
|
||||
fileLock?.Release();
|
||||
fileLock?.Dispose();
|
||||
_fileUploadLocks.TryRemove(hash, out _);
|
||||
try
|
||||
{
|
||||
fileLock?.Release();
|
||||
fileLock?.Dispose();
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// it's disposed whatever
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fileUploadLocks.TryRemove(hash, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -422,9 +442,19 @@ public class ServerFilesController : ControllerBase
|
|||
}
|
||||
finally
|
||||
{
|
||||
fileLock?.Release();
|
||||
fileLock?.Dispose();
|
||||
_fileUploadLocks.TryRemove(hash, out _);
|
||||
try
|
||||
{
|
||||
fileLock?.Release();
|
||||
fileLock?.Dispose();
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// it's disposed whatever
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fileUploadLocks.TryRemove(hash, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue