Fix downloading configuration files locking at the transfer level

This commit is contained in:
Jordan Dominion
2023-11-19 12:10:36 -05:00
parent a8c2d49608
commit 70edd0a01f
@@ -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;
},