Added RestartAsync to IRuntime instead of cancellation token
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
@@ -13,6 +14,6 @@ namespace Umbraco.Cms.Core.Services
|
||||
/// </summary>
|
||||
IRuntimeState State { get; }
|
||||
|
||||
CancellationToken CancellationToken { get; }
|
||||
Task RestartAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace Umbraco.Cms.Infrastructure.Runtime
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly DatabaseBuilder _databaseBuilder;
|
||||
private readonly IUmbracoVersion _umbracoVersion;
|
||||
private CancellationToken _cancellationToken;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CoreRuntime"/> class.
|
||||
@@ -66,12 +67,16 @@ namespace Umbraco.Cms.Infrastructure.Runtime
|
||||
/// Gets the state of the Umbraco runtime.
|
||||
/// </summary>
|
||||
public IRuntimeState State { get; }
|
||||
public CancellationToken CancellationToken { get; private set; }
|
||||
public async Task RestartAsync()
|
||||
{
|
||||
await StopAsync(_cancellationToken);
|
||||
await StartAsync(_cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
CancellationToken = cancellationToken;
|
||||
_cancellationToken = cancellationToken;
|
||||
StaticApplicationLogging.Initialize(_loggerFactory);
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (_, args) =>
|
||||
|
||||
@@ -100,8 +100,7 @@ namespace Umbraco.Cms.Web.BackOffice.Install
|
||||
public async Task<ActionResult> CompleteInstall()
|
||||
{
|
||||
|
||||
await _runtime.StopAsync(_runtime.CancellationToken);
|
||||
await _runtime.StartAsync(_runtime.CancellationToken);
|
||||
await _runtime.RestartAsync();
|
||||
|
||||
var identityUser = await _backOfficeUserManager.FindByIdAsync(Core.Constants.Security.SuperUserIdAsString);
|
||||
_backOfficeSignInManager.SignInAsync(identityUser, false);
|
||||
|
||||
Reference in New Issue
Block a user