From 5eb5cb7e2b4b9c2970aea2aefdf96bb5a219e9a4 Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Thu, 30 Jun 2022 09:57:45 +0200 Subject: [PATCH] Fix up after merge --- .../Runtime/FileSystemMainDomLock.cs | 14 +++++++------- .../Scoping/ScopeProvider.cs | 3 --- .../Filters/OutgoingEditorModelEventAttribute.cs | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Infrastructure/Runtime/FileSystemMainDomLock.cs b/src/Umbraco.Infrastructure/Runtime/FileSystemMainDomLock.cs index f9ce2837e0..26b8d55f96 100644 --- a/src/Umbraco.Infrastructure/Runtime/FileSystemMainDomLock.cs +++ b/src/Umbraco.Infrastructure/Runtime/FileSystemMainDomLock.cs @@ -11,8 +11,7 @@ internal class FileSystemMainDomLock : IMainDomLock { private readonly CancellationTokenSource _cancellationTokenSource = new(); private readonly IHostingEnvironment _hostingEnvironment; - private readonly IHostingEnvironment _hostingEnvironment; - private readonly IOptionsMonitor _globalSettings; + private readonly IOptionsMonitor _globalSettings; private readonly string _lockFilePath; private readonly ILogger _logger; private readonly string _releaseSignalFilePath; @@ -28,7 +27,7 @@ internal class FileSystemMainDomLock : IMainDomLock { _logger = logger; _hostingEnvironment = hostingEnvironment; - _globalSettings = globalSettings; + _globalSettings = globalSettings; var lockFileName = $"MainDom_{mainDomKeyGenerator.GenerateKey()}.lock"; _lockFilePath = Path.Combine(hostingEnvironment.LocalTempPath, lockFileName); @@ -44,7 +43,8 @@ internal class FileSystemMainDomLock : IMainDomLock { try { - Directory.CreateDirectory(_hostingEnvironment.LocalTempPath);_logger.LogDebug("Attempting to obtain MainDom lock file handle {lockFilePath}", _lockFilePath); + Directory.CreateDirectory(_hostingEnvironment.LocalTempPath); + _logger.LogDebug("Attempting to obtain MainDom lock file handle {lockFilePath}", _lockFilePath); _lockFileStream = File.Open(_lockFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); DeleteLockReleaseSignalFile(); return Task.FromResult(true); @@ -65,8 +65,7 @@ internal class FileSystemMainDomLock : IMainDomLock _lockFileStream?.Close(); return Task.FromResult(false); } - } - while (stopwatch.ElapsedMilliseconds < millisecondsTimeout); + } while (stopwatch.ElapsedMilliseconds < millisecondsTimeout); return Task.FromResult(false); } @@ -95,7 +94,8 @@ internal class FileSystemMainDomLock : IMainDomLock } public void CreateLockReleaseSignalFile() => - File.Open(_releaseSignalFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite | FileShare.Delete) + File.Open(_releaseSignalFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, + FileShare.ReadWrite | FileShare.Delete) .Close(); public void DeleteLockReleaseSignalFile() => diff --git a/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs b/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs index 9431af4eb9..31249daa67 100644 --- a/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs +++ b/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs @@ -10,9 +10,6 @@ using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Web.Common.DependencyInjection; using Umbraco.Extensions; -using Umbraco.Cms.Core.DistributedLocking; -using Umbraco.Cms.Core.Scoping; -using Umbraco.Cms.Web.Common.DependencyInjection; using CoreDebugSettings = Umbraco.Cms.Core.Configuration.Models.CoreDebugSettings; #if DEBUG_SCOPES diff --git a/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs index bc19688427..3121e654af 100644 --- a/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs @@ -27,7 +27,7 @@ internal sealed class OutgoingEditorModelEventAttribute : TypeFilterAttribute private class OutgoingEditorModelEventFilter : IActionFilter { - private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;private readonly IUmbracoMapper _mapper; + private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; private readonly IEventAggregator _eventAggregator; private readonly IUmbracoMapper _mapper; private readonly IUmbracoContextAccessor _umbracoContextAccessor;