public function scheduleNowAction()
    {
        $code = $this->getArg('code');
        if (empty($code)) {
            echo "\nNo code found!\n\n";
            echo $this->usageHelp();
            exit(1);
        }

        $allowedCodes = Mage::getSingleton('aoe_scheduler/job')->getResource()->getJobCodes();
        if (!in_array($code, $allowedCodes)) {
            echo "\nNo valid job found!\n\n";
            echo $this->usageHelp();
            exit(1);
        }

        $schedule = Mage::getModel('cron/schedule'); /* @var $schedule Aoe_Scheduler_Model_Schedule */
        $schedule->setScheduledReason(Aoe_Scheduler_Model_Schedule::REASON_SCHEDULENOW_CLI);
        $schedule->setJobCode($code);
        $schedule->schedule();
        $schedule->save();
    }
public function scheduleNowAction()
    {
        $code = $this->getArg('code');
        if (empty($code)) {
            echo "\nNo code found!\n\n";
            echo $this->usageHelp();
            exit(1);
        }

        $allowedCodes = Mage::getSingleton('aoe_scheduler/job')->getResource()->getJobCodes();
        if (!in_array($code, $allowedCodes)) {
            echo "\nNo valid job found!\n\n";
            echo $this->usageHelp();
            exit(1);
        }

        $schedule = Mage::getModel('cron/schedule'); /* @var $schedule Aoe_Scheduler_Model_Schedule */
        $schedule->setScheduledReason(Aoe_Scheduler_Model_Schedule::REASON_SCHEDULENOW_CLI);
        $schedule->setJobCode($code);
        $schedule->schedule();
        $schedule->save();
    }
public function scheduleNowAction ( ) { $ code = $ this -> getArg ( 'code' ) ; if ( empty ( $ code ) ) { echo "\nNo code found!\n\n" ; echo $ this -> usageHelp ( ) ; exit ( 1 ) ; } $ allowedCodes = Mage :: getSingleton ( 'aoe_scheduler/job' ) -> getResource ( ) -> getJobCodes ( ) ; if ( ! in_array ( $ code , $ allowedCodes ) ) { echo "\nNo valid job found!\n\n" ; echo $ this -> usageHelp ( ) ; exit ( 1 ) ; } $ schedule = Mage :: getModel ( 'cron/schedule' ) ; /* @var $schedule Aoe_Scheduler_Model_Schedule */ $ schedule -> setScheduledReason ( Aoe_Scheduler_Model_Schedule :: REASON_SCHEDULENOW_CLI ) ; $ schedule -> setJobCode ( $ code ) ; $ schedule -> schedule ( ) ; $ schedule -> save ( ) ; }
Schedule a job now

@return void
Schedule a job now