Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/Umbraco.PublishedCache.NuCache/ContentStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,12 @@
{
if (_writeLock.CurrentCount != 0)
{
throw new InvalidOperationException("Write lock must be acquried.");
throw new InvalidOperationException("Write lock must be acquired.");
}
}

private void Lock(WriteLockInfo lockInfo, bool forceGen = false)
{
if (_writeLock.CurrentCount == 0)
{
throw new InvalidOperationException("Recursive locks not allowed");
}

if (_writeLock.Wait(_monitorTimeout))
{
lockInfo.Taken = true;
Expand Down Expand Up @@ -413,7 +408,16 @@
{
if (lockInfo.Taken)
{
_writeLock.Release();
if (_writeLock.CurrentCount == 0)
{
_writeLock.Release();
}
else
{
_logger.LogWarning(
"On releasing the content store lock the current count was found unexpectedly to be non-zero with a value of {CurrentCount}.",
_writeLock.CurrentCount);
}

Check warning on line 420 in src/Umbraco.PublishedCache.NuCache/ContentStore.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v13/dev)

❌ New issue: Bumpy Road Ahead

Release has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
}
}
}
Expand Down
Loading