MediaWiki master
CdnPurgeJob.php
Go to the documentation of this file.
1<?php
8
12
19class CdnPurgeJob extends Job implements GenericParameterJob {
20 public function __construct( array $params ) {
21 parent::__construct( 'cdnPurge', $params );
22 $this->removeDuplicates = false; // delay semantics are critical
23 }
24
26 public function run() {
27 // Use purge() directly to avoid infinite recursion
28 CdnCacheUpdate::purge( $this->params['urls'] );
29
30 return true;
31 }
32}
33
35class_alias( CdnPurgeJob::class, 'CdnPurgeJob' );
Handles purging the appropriate CDN objects given a list of URLs or Title instances.
Describe and execute a background job.
Definition Job.php:27
array $params
Array of job parameters.
Definition Job.php:32
Job to purge a set of URLs from CDN.
run()
Run the job.If this method returns false or completes exceptionally, the job runner will retry execut...
Interface for generic jobs only uses the parameters field and are JSON serializable.