/// <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();
     });
 }
Exemple #2
0
 /// <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);
     });
 }
Exemple #3
0
 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);
                }
            }
        }
Exemple #5
0
        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);
                    }
                }
            }
        }
Exemple #7
0
        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();
 }
Exemple #9
0
 /// <summary>
 /// Posts the specified request.
 /// </summary>
 /// <param name="request">The request.</param>
 public void Post(RestartApplication request)
 {
     _appHost.Restart();
 }
Exemple #10
0
 /// <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);
 }