dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "filebackend: clean up some comments and remove unused FileBackendStoreOpHandle...
[lhc/web/wiklou.git]
/
includes
/
jobqueue
/
JobQueueMemory.php
diff --git
a/includes/jobqueue/JobQueueMemory.php
b/includes/jobqueue/JobQueueMemory.php
index
6c45e96
..
b26129e
100644
(file)
--- a/
includes/jobqueue/JobQueueMemory.php
+++ b/
includes/jobqueue/JobQueueMemory.php
@@
-32,6
+32,12
@@
class JobQueueMemory extends JobQueue {
/** @var array[] */
protected static $data = [];
/** @var array[] */
protected static $data = [];
+ public function __construct( array $params ) {
+ $params['wanCache'] = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
+
+ parent::__construct( $params );
+ }
+
/**
* @see JobQueue::doBatchPush
*
/**
* @see JobQueue::doBatchPush
*
@@
-43,10
+49,7
@@
class JobQueueMemory extends JobQueue {
foreach ( $jobs as $job ) {
if ( $job->ignoreDuplicates() ) {
foreach ( $jobs as $job ) {
if ( $job->ignoreDuplicates() ) {
- $sha1 = Wikimedia\base_convert(
- sha1( serialize( $job->getDeduplicationInfo() ) ),
- 16, 36, 31
- );
+ $sha1 = sha1( serialize( $job->getDeduplicationInfo() ) );
if ( !isset( $unclaimed[$sha1] ) ) {
$unclaimed[$sha1] = $job;
}
if ( !isset( $unclaimed[$sha1] ) ) {
$unclaimed[$sha1] = $job;
}
@@
-108,7
+111,7
@@
class JobQueueMemory extends JobQueue {
/**
* @see JobQueue::doPop
*
/**
* @see JobQueue::doPop
*
- * @return Job|bool
+ * @return
Runnable
Job|bool
*/
protected function doPop() {
if ( $this->doGetSize() == 0 ) {
*/
protected function doPop() {
if ( $this->doGetSize() == 0 ) {
@@
-140,15
+143,15
@@
class JobQueueMemory extends JobQueue {
/**
* @see JobQueue::doAck
*
/**
* @see JobQueue::doAck
*
- * @param Job $job
+ * @param
Runnable
Job $job
*/
*/
- protected function doAck( Job $job ) {
+ protected function doAck(
Runnable
Job $job ) {
if ( $this->getAcquiredCount() == 0 ) {
return;
}
$claimed =& $this->getQueueData( 'claimed' );
if ( $this->getAcquiredCount() == 0 ) {
return;
}
$claimed =& $this->getQueueData( 'claimed' );
-
$job->setMetadata( 'claimId', null
);
+
unset( $claimed[$job->getMetadata( 'claimId' )]
);
}
/**
}
/**
@@
-203,11
+206,10
@@
class JobQueueMemory extends JobQueue {
/**
* @param IJobSpecification $spec
/**
* @param IJobSpecification $spec
- *
- * @return Job
+ * @return RunnableJob
*/
public function jobFromSpecInternal( IJobSpecification $spec ) {
*/
public function jobFromSpecInternal( IJobSpecification $spec ) {
- return
Job::factory( $spec->getType(), $spec->getTitl
e(), $spec->getParams() );
+ return
$this->factoryJob( $spec->getTyp
e(), $spec->getParams() );
}
/**
}
/**