/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(RestartApplication request) { Task.Run(async() => { await Task.Delay(100); _appHost.Restart(); }); }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(RestartApplication request) { Task.Run(async() => { await Task.Delay(100).ConfigureAwait(false); await _appHost.Restart().ConfigureAwait(false); }); }
public ActionResult RestartApplication() { Task.Run(async() => { await Task.Delay(100).ConfigureAwait(false); _appHost.Restart(); }); return(NoContent()); }
private void TimerCallback(object state) { if (IsIdle()) { DisposeTimer(); try { _appHost.Restart(); } catch (Exception ex) { _logger.ErrorException("Error restarting server", ex); } } }
private void TimerCallback(object state) { if (_config.Configuration.EnableAutomaticRestart && IsIdle()) { DisposeTimer(); try { _appHost.Restart(); } catch (Exception ex) { _logger.ErrorException("Error restarting server", ex); } } }
private async void TimerCallback(object state) { if (_config.Configuration.EnableAutomaticRestart) { var isIdle = await IsIdle().ConfigureAwait(false); if (isIdle) { DisposeTimer(); try { _appHost.Restart(); } catch (Exception ex) { _logger.ErrorException("Error restarting server", ex); } } } }
private async void TimerCallback(object state) { if (_config.Configuration.EnableAutomaticRestart) { var isIdle = await IsIdle().ConfigureAwait(false); if (isIdle) { DisposeTimer(); _logger.LogInformation("Automatically restarting the system because it is idle and a restart is required."); try { _appHost.Restart(); } catch (Exception ex) { _logger.LogError(ex, "Error restarting server"); } } } }
void cmdRestart_Click(object sender, EventArgs e) { _appHost.Restart(); }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(RestartApplication request) { _appHost.Restart(); }
/// <summary> /// Handles the click event of the cmdReloadServer control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private async void cmdReloadServer_click(object sender, RoutedEventArgs e) { await _appHost.Restart().ConfigureAwait(false); }