예제 #1
0
        private void TriggerRestart(object sender, ElapsedEventArgs e)
        {
            if (!backupManager.Processing && !renderManager.Processing)
            {
                restarting = true;
                OnGoingDown();

                bdsWatchdog.Disable();
                bds.SendInput("stop");
                bds.Process.WaitForExit();
                bds.Close();

                Log(String.Format(RConfig.TextStrings.LogRestart, RConfig.DailyRestartTime));
                System.Threading.Thread.Sleep(10000);

                bds.Start();
                bdsWatchdog.Enable();

                OnStartingUp();
            }
            else
            {
                // if a backup or render is still going, abort restart and try again in twice the warning time
                SendTellraw(RConfig.TextStrings.RestartAbort);
                delayTimer.Start();
            }
        }