$this->urls = $urlArr;
}
+ public function merge( MergeableUpdate $update ) {
+ /** @var CdnCacheUpdate $update */
+ Assert::parameterType( __CLASS__, $update, '$update' );
+
+ $this->urls = array_merge( $this->urls, $update->urls );
+ }
+
/**
* Create an update object from an array of Title objects, or a TitleArray object
*
* Purges the list of URLs passed to the constructor.
*/
public function doUpdate() {
- self::purge( $this->urls );
- }
+ global $wgCdnReboundPurgeDelay;
- public function merge( MergeableUpdate $update ) {
- /** @var CdnCacheUpdate $update */
- Assert::parameterType( __CLASS__, $update, '$update' );
+ self::purge( $this->urls );
- $this->urls = array_merge( $this->urls, $update->urls );
+ if ( $wgCdnReboundPurgeDelay > 0 ) {
+ JobQueueGroup::singleton()->lazyPush( new CdnPurgeJob(
+ Title::makeTitle( NS_SPECIAL, 'Badtitle/' . __CLASS__ ),
+ array(
+ 'urls' => $this->urls,
+ 'jobReleaseTimestamp' => time() + $wgCdnReboundPurgeDelay
+ )
+ ) );
+ }
}
/**