Command/RecrawlCommand.php
/**
     * Consume a message, extracts the URL from it and crawls the webpage.
     *
     * @param \PhpAmqpLib\Message\AMQPMessage $message
     */
Consume a message, extracts the URL from it and crawls the webpage.
Consume a message extracts the URL from it and crawls the webpage .
public function recrawl(AMQPMessage $message)
    {
        try {
            $body = json_decode($message->body);
            if (is_array($body->blacklist) && count($body->blacklist) > 0) {
                $this->dropBlacklistedDocuments($body->blacklist, $body->metadata);
            }
            $this->queue->acknowledge($message);
        } catch (Exception $e) {
            $this->queue->rejectMessage($message);
            $this->logMessage(
                "emergency",
                $e->getMessage(),
                $body->metadata->core
            );
        }
    }
public function recrawl ( AMQPMessage $ message ) { try { $ body = json_decode ( $ message -> body ) ; if ( is_array ( $ body -> blacklist ) && count ( $ body -> blacklist ) > 0 ) { $ this -> dropBlacklistedDocuments ( $ body -> blacklist , $ body -> metadata ) ; } $ this -> queue -> acknowledge ( $ message ) ; } catch ( Exception $ e ) { $ this -> queue -> rejectMessage ( $ message ) ; $ this -> logMessage ( " emergency " , $ e -> getMessage ( ) , $ body -> metadata -> core ) ; } }
Consume a message, extracts the URL from it and crawls the webpage.
Consume a message extracts the URL from it and crawls the webpage .
// checking blacklist