Update Changelog, log restarts

This commit is contained in:
nicolas.dorier
2023-01-19 20:22:58 +09:00
parent b577c0adb7
commit 5f24b41250
2 changed files with 8 additions and 2 deletions

View File

@@ -133,7 +133,6 @@ namespace BTCPayServer.Controllers
public async Task<IActionResult> Maintenance(MaintenanceViewModel vm, string command)
{
vm.CanUseSSH = _sshState.CanUseSSH;
if (command != "soft-restart" && !vm.CanUseSSH)
{
TempData[WellKnownTempData.ErrorMessage] = "Maintenance feature requires access to SSH properly configured in BTCPay Server configuration.";
@@ -221,12 +220,14 @@ namespace BTCPayServer.Controllers
var error = await RunSSH(vm, $"btcpay-restart.sh");
if (error != null)
return error;
Logs.PayServer.LogInformation("A hard restart has been requested");
TempData[WellKnownTempData.SuccessMessage] = $"BTCPay will restart momentarily.";
}
else if (command == "soft-restart")
{
TempData[WellKnownTempData.SuccessMessage] = $"BTCPay will restart momentarily.";
ApplicationLifetime.StopApplication();
Logs.PayServer.LogInformation("A soft restart has been requested");
_ = Task.Delay(3000).ContinueWith((t) => ApplicationLifetime.StopApplication());
}
else
{