protected function discardJob()
    {
        $this->skipped = true;

        // If we do not have dirty records, then assume that these dirty records were committed
        // already this request (but probably another job), so we don't need to commit anything else.
        // This could occur if we completed multiple searchupdate jobs in a prior request, and
        // we only need one commit job to commit all of them in the current request.
        if (empty(static::$dirty_indexes)) {
            $this->addMessage("Indexing already completed this request: Discarding this job");
            return;
        }


        // If any commit has run, but some (or all) indexes are un-comitted, we must re-schedule this task.
        // This could occur if we completed a searchupdate job in a prior request, as well as in
        // the current request
        $cooldown = Config::inst()->get(__CLASS__, 'cooldown');
        $now = new DateTime(DBDatetime::now()->getValue());
        $now->add(new DateInterval('PT' . $cooldown . 'S'));
        $runat = $now->Format('Y-m-d H:i:s');

        $this->addMessage("Indexing already run this request, but incomplete. Re-scheduling for {$runat}");

        // Queue after the given cooldown
        static::queue(false, $runat);
    }
protected function discardJob()
    {
        $this->skipped = true;

        // If we do not have dirty records, then assume that these dirty records were committed
        // already this request (but probably another job), so we don't need to commit anything else.
        // This could occur if we completed multiple searchupdate jobs in a prior request, and
        // we only need one commit job to commit all of them in the current request.
        if (empty(static::$dirty_indexes)) {
            $this->addMessage("Indexing already completed this request: Discarding this job");
            return;
        }


        // If any commit has run, but some (or all) indexes are un-comitted, we must re-schedule this task.
        // This could occur if we completed a searchupdate job in a prior request, as well as in
        // the current request
        $cooldown = Config::inst()->get(__CLASS__, 'cooldown');
        $now = new DateTime(DBDatetime::now()->getValue());
        $now->add(new DateInterval('PT' . $cooldown . 'S'));
        $runat = $now->Format('Y-m-d H:i:s');

        $this->addMessage("Indexing already run this request, but incomplete. Re-scheduling for {$runat}");

        // Queue after the given cooldown
        static::queue(false, $runat);
    }
protected function discardJob ( ) { $ this -> skipped = true ; // If we do not have dirty records, then assume that these dirty records were committed // already this request (but probably another job), so we don't need to commit anything else. // This could occur if we completed multiple searchupdate jobs in a prior request, and // we only need one commit job to commit all of them in the current request. if ( empty ( static :: $ dirty_indexes ) ) { $ this -> addMessage ( "Indexing already completed this request: Discarding this job" ) ; return ; } // If any commit has run, but some (or all) indexes are un-comitted, we must re-schedule this task. // This could occur if we completed a searchupdate job in a prior request, as well as in // the current request $ cooldown = Config :: inst ( ) -> get ( __CLASS__ , 'cooldown' ) ; $ now = new DateTime ( DBDatetime :: now ( ) -> getValue ( ) ) ; $ now -> add ( new DateInterval ( 'PT' . $ cooldown . 'S' ) ) ; $ runat = $ now -> Format ( 'Y-m-d H:i:s' ) ; $ this -> addMessage ( "Indexing already run this request, but incomplete. Re-scheduling for {$runat}" ) ; // Queue after the given cooldown static :: queue ( false , $ runat ) ; }
Abort this job, potentially rescheduling a replacement if there is still work to do
Abort this job potentially rescheduling a replacement if there is still work to do