Example #1
0
 /**
  * Update all of the backlinks
  */
 protected function doFullUpdate()
 {
     global $wgMaxBacklinksInvalidate;
     # Get an estimate of the number of rows from the BacklinkCache
     $max = max($this->rowsPerJob * 2, $wgMaxBacklinksInvalidate) + 1;
     $numRows = $this->blCache->getNumLinks($this->params['table'], $max);
     if ($wgMaxBacklinksInvalidate !== false && $numRows > $wgMaxBacklinksInvalidate) {
         wfDebug("Skipped HTML cache invalidation of {$this->title->getPrefixedText()}.");
         return true;
     }
     if ($numRows > $this->rowsPerJob * 2) {
         # Do fast cached partition
         $this->insertPartitionJobs();
     } else {
         # Get the links from the DB
         $titleArray = $this->blCache->getLinks($this->params['table']);
         # Check if the row count estimate was correct
         if ($titleArray->count() > $this->rowsPerJob * 2) {
             # Not correct, do accurate partition
             wfDebug(__METHOD__ . ": row count estimate was incorrect, repartitioning\n");
             $this->insertJobsFromTitles($titleArray);
         } else {
             $this->invalidateTitles($titleArray);
             // just do the query
         }
     }
     return true;
 }
 /**
  * Update all of the backlinks
  */
 protected function doFullUpdate()
 {
     # Get an estimate of the number of rows from the BacklinkCache
     $numRows = $this->blCache->getNumLinks($this->params['table']);
     if ($numRows > $this->rowsPerJob * 2) {
         # Do fast cached partition
         $this->insertPartitionJobs();
     } else {
         # Get the links from the DB
         $titleArray = $this->blCache->getLinks($this->params['table']);
         # Check if the row count estimate was correct
         if ($titleArray->count() > $this->rowsPerJob * 2) {
             # Not correct, do accurate partition
             wfDebug(__METHOD__ . ": row count estimate was incorrect, repartitioning\n");
             $this->insertJobsFromTitles($titleArray);
         } else {
             $this->invalidateTitles($titleArray);
             // just do the query
         }
     }
     return true;
 }