Changeset 365


Ignore:
Timestamp:
May 21, 2008, 8:45:07 AM (17 years ago)
Author:
george
Message:

Upraveno: Odstranění čekací doby po restartu MaNGOSu a na místo toho čekání na nový správný uptime.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • system/freeze_restart.php

    r357 r365  
    44$LoopSleepTime = 10; // Checking period [seconds]
    55$MangosProcessName = '/a/mangos/bin/mangos-worldd';
    6 $RestartDelay = 2 * 60;
    76
    87include('../global.php');
     
    2019  echo('Uptime DB: '.$DbUptime.' vs. Real: '.$RealUptime." [s],  Restart condition ".$TimeDifference." > ".$RestartDeadTime.
    2120    " (".round($TimeDifference / $RestartDeadTime * 100)."%)\n");
    22   if(($TimeDifference > $RestartDeadTime) and ($Restarted == 0))
    23   {
    24     echo("Restarting MaNGOS...\n");
    25     exec("ps -ef | grep '".$MangosProcessName."' | grep -v grep | awk '{print $2}' | xargs -i kill {}");
    26     $Restarted = 1;  // Restart only once and wait for new good uptime
    27     echo('Start delay '.$RestartDelay."\n");
    28     Sleep($RestartDelay);
    29   } else $Restarted = 0;
     21  if($TimeDifference > $RestartDeadTime)
     22  {
     23    if($Restarted == 0)
     24    {
     25      echo("Restarting MaNGOS...\n");
     26      exec("ps -ef | grep '".$MangosProcessName."' | grep -v grep | awk '{print $2}' | xargs -i kill {}");
     27      $Restarted = 1;  // Restart only once and wait for new good uptime
     28      echo("Waiting for new good uptime...\n");
     29    }
     30  } else
     31  {
     32    if($Restarted == 1)
     33    {
     34      echo("MaNGOS is back online.\n");
     35      $Restarted = 0;
     36    }
     37  }
    3038  Sleep($LoopSleepTime);
    3139}
Note: See TracChangeset for help on using the changeset viewer.