From e998fce5d1cecf1592f72c8bfb378af9060d3769 Mon Sep 17 00:00:00 2001 From: JohnBlair Date: Thu, 17 Oct 2019 19:00:00 +0100 Subject: [PATCH] Trying to lock could throw exceptions so always make sure to properly clean up the local DB. --- .../PublishedCache/NuCache/ContentStore.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs index 1bd58c3878..3fe4b8aecd 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs @@ -234,11 +234,17 @@ namespace Umbraco.Web.PublishedCache.NuCache var lockInfo = new WriteLockInfo(); try { - Lock(lockInfo); - - if (_localDb == null) return; - _localDb.Dispose(); - _localDb = null; + try{ + // Trying to lock could throw exceptions so always make sure to clean up. + Lock(lockInfo); + } + catch + { + if (_localDb == null) return; + _localDb.Dispose(); + _localDb = null; + } + } finally {