EventListener/PersistenceEventListener.php
/**
     * Increase the time a document should be revisited.
     *
     * @param \Simgroep\ConcurrentSpiderBundle\PersistableDocument $document
     * @param integer                                              $currentRevisitFactor
     *
     * @return \Simgroep\ConcurrentSpiderBundle\PersistableDocument
     */
Increase the time a document should be revisited.


Increase the time a document should be revisited .
private function increaseRevisitFactor(PersistableDocument $document, $currentRevisitFactor)
    {
        if (($currentRevisitFactor * 2) > $this->maximumRevisitFactor) {
            $document['revisit_after'] = $this->maximumRevisitFactor;
        } else {
            $document['revisit_after'] = $currentRevisitFactor * 2;
        }
        $expireDate = new DateTime();
        $expireDate->modify(sprintf('+%s minute', $document['revisit_after']));
        $document['revisit_expiration'] = $expireDate->format('Y-m-d\TH:i:s\Z');
    }
private function increaseRevisitFactor ( PersistableDocument $ document , $ currentRevisitFactor ) { if ( ( $ currentRevisitFactor * 2 ) > $ this -> maximumRevisitFactor ) { $ document [ 'revisit_after' ] = $ this -> maximumRevisitFactor ; } else { $ document [ 'revisit_after' ] = $ currentRevisitFactor * 2 ; } $ expireDate = new DateTime ( ) ; $ expireDate -> modify ( sprintf ( '+%s minute' , $ document [ 'revisit_after' ] ) ) ; $ document [ 'revisit_expiration' ] = $ expireDate -> format ( 'Y-m-d\TH:i:s\Z' ) ; }
Increase the time a document should be revisited.
Increase the time a document should be revisited .