Exemplo n.º 1
0
 static function stop()
 {
     Debug::out('Stopping');
     //set lock to tell existing cron to turn off
     if (!Lock::on('cron-off-' . $_ENV['projectName'])) {
         Debug::quit('Lock off failed');
     }
     echo "\n";
     //wait for exist cron to turn off
     while (Lock::isOn('cron-running-' . $_ENV['projectName'])) {
         echo '.';
         sleep(1);
     }
     //remove lock off
     Lock::off('cron-off-' . $_ENV['projectName']);
     Debug::out('Stopped');
 }