public function getDeduplicationInfo()
 {
     $info = parent::getDeduplicationInfo();
     if (is_array($info['params'])) {
         $info['params'] = array('filekey' => $info['params']['filekey']);
     }
     return $info;
 }
Example #2
0
 /**
  * @return Array
  */
 public function getDeduplicationInfo()
 {
     $info = parent::getDeduplicationInfo();
     // Don't let highly unique "masterPos" values ruin duplicate detection
     if (is_array($info['params'])) {
         unset($info['params']['masterPos']);
     }
     return $info;
 }
Example #3
0
 public function getDeduplicationInfo()
 {
     $info = parent::getDeduplicationInfo();
     if (is_array($info['params'])) {
         // Don't let highly unique "masterPos" values ruin duplicate detection
         unset($info['params']['masterPos']);
         // For per-pages jobs, the job title is that of the template that changed
         // (or similar), so remove that since it ruins duplicate detection
         if (isset($info['pages'])) {
             unset($info['namespace']);
             unset($info['title']);
         }
     }
     return $info;
 }
 public function getDeduplicationInfo()
 {
     $info = parent::getDeduplicationInfo();
     unset($info['params']['revTimestamp']);
     // first job wins
     return $info;
 }
Example #5
0
 /**
  * @param $job Job
  * @return array
  */
 protected function insertFields(Job $job)
 {
     list($dbw, $scope) = $this->getMasterDB();
     return array('job_cmd' => $job->getType(), 'job_namespace' => $job->getTitle()->getNamespace(), 'job_title' => $job->getTitle()->getDBkey(), 'job_params' => self::makeBlob($job->getParams()), 'job_id' => $dbw->nextSequenceValue('job_job_id_seq'), 'job_timestamp' => $dbw->timestamp(), 'job_sha1' => wfBaseConvert(sha1(serialize($job->getDeduplicationInfo())), 16, 36, 31), 'job_random' => mt_rand(0, self::MAX_JOB_RANDOM));
 }
Example #6
0
 /**
  * @param $job Job
  * @return array
  */
 protected function getNewJobFields(Job $job)
 {
     return array('type' => $job->getType(), 'namespace' => $job->getTitle()->getNamespace(), 'title' => $job->getTitle()->getDBkey(), 'params' => $job->getParams(), 'rtimestamp' => $job->getReleaseTimestamp() ?: 0, 'uuid' => UIDGenerator::newRawUUIDv4(UIDGenerator::QUICK_RAND), 'sha1' => $job->ignoreDuplicates() ? wfBaseConvert(sha1(serialize($job->getDeduplicationInfo())), 16, 36, 31) : '', 'timestamp' => time());
 }
Example #7
0
	/**
	 * @param $job Job
	 * @return array
	 */
	protected function getNewJobFields( Job $job ) {
		return array(
			// Fields that describe the nature of the job
			'type'       => $job->getType(),
			'namespace'  => $job->getTitle()->getNamespace(),
			'title'      => $job->getTitle()->getDBkey(),
			'params'     => $job->getParams(),
			// Some jobs cannot run until a "release timestamp"
			'rtimestamp' => $job->getReleaseTimestamp() ?: 0,
			// Additional job metadata
			'uuid'       => UIDGenerator::newRawUUIDv4( UIDGenerator::QUICK_RAND ),
			'sha1'       => $job->ignoreDuplicates()
				? wfBaseConvert( sha1( serialize( $job->getDeduplicationInfo() ) ), 16, 36, 31 )
				: '',
			'timestamp'  => time() // UNIX timestamp
		);
	}
Example #8
0
	/**
	 * @param $job Job
	 * @return array
	 */
	protected function insertFields( Job $job ) {
		$dbw = $this->getMasterDB();
		return array(
			// Fields that describe the nature of the job
			'job_cmd'       => $job->getType(),
			'job_namespace' => $job->getTitle()->getNamespace(),
			'job_title'     => $job->getTitle()->getDBkey(),
			'job_params'    => self::makeBlob( $job->getParams() ),
			// Additional job metadata
			'job_id'        => $dbw->nextSequenceValue( 'job_job_id_seq' ),
			'job_timestamp' => $dbw->timestamp(),
			'job_sha1'      => wfBaseConvert(
				sha1( serialize( $job->getDeduplicationInfo() ) ),
				16, 36, 31
			),
			'job_random'    => mt_rand( 0, self::MAX_JOB_RANDOM )
		);
	}