From 70edd0a01f2cfc0fecac50a5eaaa43d3b7343a50 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 19 Nov 2023 12:10:36 -0500 Subject: [PATCH] Fix downloading configuration files locking at the transfer level --- .../Components/StaticFiles/Configuration.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs b/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs index 0a9a356e77..a9406e0e8d 100644 --- a/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs +++ b/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs @@ -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; },