summaryrefslogtreecommitdiff
path: root/includes/cache/HTMLCacheUpdate.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/cache/HTMLCacheUpdate.php')
-rw-r--r--includes/cache/HTMLCacheUpdate.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/includes/cache/HTMLCacheUpdate.php b/includes/cache/HTMLCacheUpdate.php
index d542800d..11e2ae74 100644
--- a/includes/cache/HTMLCacheUpdate.php
+++ b/includes/cache/HTMLCacheUpdate.php
@@ -23,8 +23,7 @@
*
* @ingroup Cache
*/
-class HTMLCacheUpdate
-{
+class HTMLCacheUpdate implements DeferrableUpdate {
/**
* @var Title
*/
@@ -33,6 +32,12 @@ class HTMLCacheUpdate
public $mTable, $mPrefix, $mStart, $mEnd;
public $mRowsPerJob, $mRowsPerQuery;
+ /**
+ * @param $titleTo
+ * @param $table
+ * @param $start bool
+ * @param $end bool
+ */
function __construct( $titleTo, $table, $start = false, $end = false ) {
global $wgUpdateRowsPerJob, $wgUpdateRowsPerQuery;
@@ -138,6 +143,9 @@ class HTMLCacheUpdate
Job::batchInsert( $jobs );
}
+ /**
+ * @return mixed
+ */
protected function insertJobs() {
$batches = $this->mCache->partition( $this->mTable, $this->mRowsPerJob );
if ( !$batches ) {
@@ -157,6 +165,7 @@ class HTMLCacheUpdate
/**
* Invalidate an array (or iterator) of Title objects, right now
+ * @param $titleArray array
*/
protected function invalidateTitles( $titleArray ) {
global $wgUseFileCache, $wgUseSquid;
@@ -179,7 +188,7 @@ class HTMLCacheUpdate
foreach ( $batches as $batch ) {
$dbw->update( 'page',
array( 'page_touched' => $timestamp ),
- array( 'page_id IN (' . $dbw->makeList( $batch ) . ')' ),
+ array( 'page_id' => $batch ),
__METHOD__
);
}
@@ -197,9 +206,9 @@ class HTMLCacheUpdate
}
}
}
-
}
+
/**
* Job wrapper for HTMLCacheUpdate. Gets run whenever a related
* job gets called from the queue.