Removed type check for dashboard status URL from published status controller and moved to interface.

This commit is contained in:
Andy Butland
2020-01-31 15:52:08 +01:00
parent 9e89e18492
commit 50c309e613
4 changed files with 15 additions and 6 deletions

View File

@@ -161,8 +161,14 @@ namespace Umbraco.Web.PublishedCache
#endregion
#region Status
string GetStatus();
string StatusUrl { get; }
#endregion
void Collect();
}
}

View File

@@ -1788,6 +1788,8 @@ AND cmsContentNu.nodeId IS NULL
" and " + ms + " snapshot" + (ms > 1 ? "s" : "") + ".";
}
public override string StatusUrl => "views/dashboard/settings/nucache.html";
public override void Collect()
{
var contentCollect = _contentStore.CollectAsync();

View File

@@ -41,6 +41,8 @@ namespace Umbraco.Web.PublishedCache
public abstract string GetStatus();
public virtual string StatusUrl => string.Empty;
public virtual void Collect()
{
}

View File

@@ -17,13 +17,12 @@ namespace Umbraco.Web.Editors
[HttpGet]
public string GetPublishedStatusUrl()
{
return "views/dashboard/settings/nucache.html";
if (!string.IsNullOrWhiteSpace(_publishedSnapshotService.StatusUrl))
{
return _publishedSnapshotService.StatusUrl;
}
// TODO: do we need this check?
//if (_publishedSnapshotService is PublishedCache.NuCache.PublishedSnapshotService)
// return "views/dashboard/settings/nucache.html";
//throw new NotSupportedException("Not supported: " + _publishedSnapshotService.GetType().FullName);
throw new NotSupportedException("Not supported: " + _publishedSnapshotService.GetType().FullName);
}
}
}