Ensures MainDom.Register absolutely does not call install logic if it's not MainDom, adds logging

This commit is contained in:
Shannon
2019-10-21 15:47:37 +11:00
parent 44ed611b7a
commit beb16a2f79
2 changed files with 10 additions and 0 deletions

View File

@@ -101,6 +101,12 @@ namespace Umbraco.Core
lock (_locko)
{
if (_signaled) return false;
if (_isMainDom == false)
{
_logger.Warn<MainDom>("Register called when MainDom has not been acquired");
return false;
}
install?.Invoke();
if (release != null)
_callbacks.Add(new KeyValuePair<int, Action>(weight, release));

View File

@@ -132,6 +132,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
// if both local databases exist then GetTree will open them, else new databases will be created
_localContentDb = BTree.GetTree(localContentDbPath, _localDbExists);
_localMediaDb = BTree.GetTree(localMediaDbPath, _localDbExists);
_logger.Info<PublishedSnapshotService>($"Registered with MainDom, local db exists? {_localDbExists}");
},
() =>
{
@@ -144,6 +146,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
_mediaStore?.ReleaseLocalDb(); //null check because we could shut down before being assigned
_localMediaDb = null;
}
_logger.Info<PublishedSnapshotService>("Released from MainDom");
});
// stores are created with a db so they can write to it, but they do not read from it,