@@ -29,6 +29,12 @@ function xmlsitemap_drush_command() {
'limit'=>'The limit of links of each type to process. Default value: '.variable_get('xmlsitemap_batch_limit',100),
),
);
$items['xmlsitemap-queue-rebuild']=array(
'description'=>'Dump and queues all possible XML sitemap data to be re-processed via the xmlsitemap_link_process queue. This command does not regenerate the sitemap files.',
'options'=>array(
'limit'=>'The number of links to be processed in each queue task.',
),
);
return$items;
}
...
...
@@ -89,3 +95,58 @@ function drush_xmlsitemap_index() {
drush_print(dt('Indexed @count new XML sitemap links.',array('@count'=>$count_after-$count_before)));
}
}
/**
* Dump and queue all the sitemap links to be rebuilt in a queue process.
// If no enabled bundle types, skip everything else.
continue;
}
$results=$query->execute();
if(!empty($results[$entity_type])){
$ids=array_keys($results[$entity_type]);
$link_count+=count($ids);
$chunks=array_chunk($ids,$chunk_size);
$chunk_count+=count($chunks);
foreach($chunksas$chunk){
xmlsitemap_link_enqueue($entity_type,$chunk);
}
}
}
if($link_count){
drush_log(dt('Queued @link_count links for rebuild processing in the xmlsitemap_link_process (in @chunk_count chunks of up to @chunk_size links each).',array('@link_count'=>$link_count,'@chunk_count'=>$chunk_count,'@chunk_size'=>$chunk_size)),'success');
}
else{
drush_log(dt('No links to queue for rebuild processing.'),'ok');