Ensures MainDom.Register absolutely does not call install logic if it's not MainDom, adds logging
This commit is contained in:
@@ -101,6 +101,12 @@ namespace Umbraco.Core
|
|||||||
lock (_locko)
|
lock (_locko)
|
||||||
{
|
{
|
||||||
if (_signaled) return false;
|
if (_signaled) return false;
|
||||||
|
if (_isMainDom == false)
|
||||||
|
{
|
||||||
|
_logger.Warn<MainDom>("Register called when MainDom has not been acquired");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
install?.Invoke();
|
install?.Invoke();
|
||||||
if (release != null)
|
if (release != null)
|
||||||
_callbacks.Add(new KeyValuePair<int, Action>(weight, release));
|
_callbacks.Add(new KeyValuePair<int, Action>(weight, release));
|
||||||
|
|||||||
@@ -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
|
// if both local databases exist then GetTree will open them, else new databases will be created
|
||||||
_localContentDb = BTree.GetTree(localContentDbPath, _localDbExists);
|
_localContentDb = BTree.GetTree(localContentDbPath, _localDbExists);
|
||||||
_localMediaDb = BTree.GetTree(localMediaDbPath, _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
|
_mediaStore?.ReleaseLocalDb(); //null check because we could shut down before being assigned
|
||||||
_localMediaDb = null;
|
_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,
|
// stores are created with a db so they can write to it, but they do not read from it,
|
||||||
|
|||||||
Reference in New Issue
Block a user