54 parent::__construct(
'null', $params );
55 if ( !isset( $this->params[
'lives'] ) ) {
56 $this->params[
'lives'] = 1;
58 if ( !isset( $this->params[
'usleep'] ) ) {
59 $this->params[
'usleep'] = 0;
61 $this->removeDuplicates = !empty( $this->params[
'removeDuplicates'] );
64 public function run() {
65 if ( $this->params[
'usleep'] > 0 ) {
66 usleep( $this->params[
'usleep'] );
68 if ( $this->params[
'lives'] > 1 ) {
72 MediaWikiServices::getInstance()->getJobQueueGroup()->push(
$job );
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.
Degenerate job that does nothing, but can optionally replace itself in the queue and/or sleep for a b...
__construct(array $params)
Interface for generic jobs only uses the parameters field and are JSON serializable.
if(count( $args)< 1) $job