mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 07:27:18 +01:00
Fix downloading configuration files locking at the transfer level
This commit is contained in:
@@ -326,16 +326,10 @@ namespace Tgstation.Server.Host.Components.StaticFiles
|
||||
result = ioManager.GetFileStream(path, false);
|
||||
}
|
||||
|
||||
using (SemaphoreSlimContext.TryLock(semaphore, out var locked))
|
||||
{
|
||||
if (!locked)
|
||||
return null;
|
||||
|
||||
if (systemIdentity == null)
|
||||
await Task.Factory.StartNew(GetFileStream, cancellationToken, DefaultIOManager.BlockingTaskCreationOptions, TaskScheduler.Current);
|
||||
else
|
||||
await systemIdentity.RunImpersonated(GetFileStream, cancellationToken);
|
||||
}
|
||||
if (systemIdentity == null)
|
||||
await Task.Factory.StartNew(GetFileStream, cancellationToken, DefaultIOManager.BlockingTaskCreationOptions, TaskScheduler.Current);
|
||||
else
|
||||
await systemIdentity.RunImpersonated(GetFileStream, cancellationToken);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user