if (isset($queues['crawl'])) {
$gmworker->addFunction(
- 'phinde_crawl',
+ $GLOBALS['phinde']['queuePrefix'] . 'phinde_crawl',
function(\GearmanJob $job) {
$data = unserialize($job->workload());
echo "-- Crawling " . $data['url'] . "\n";
}
if (isset($queues['index'])) {
$gmworker->addFunction(
- 'phinde_index',
+ $GLOBALS['phinde']['queuePrefix'] . 'phinde_index',
function(\GearmanJob $job) {
$data = unserialize($job->workload());
echo "-- Indexing " . $data['url'] . "\n";
//if directly linked URLs shall be indexed, even if they are
// on a non-whitelisted domain
'indexNonAllowed' => true,
+ //prefix for the gearman queue names, needed when multiple instances
+ //are running in parallel
+ 'queuePrefix' => '',
);
?>
\ No newline at end of file
{
echo "Queuing for indexing: $linkUrl\n";
$this->gmclient->doBackground(
- 'phinde_index',
+ $GLOBALS['phinde']['queuePrefix'] . 'phinde_index',
serialize(
array(
'url' => $linkUrl,
{
echo "Queuing for crawling: $linkUrl\n";
$this->gmclient->doBackground(
- 'phinde_crawl',
+ $GLOBALS['phinde']['queuePrefix'] . 'phinde_crawl',
serialize(
array(
'url' => $linkUrl