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
[JobQueue] Do not count claimed jobs in isEmpty().
[lhc/web/wiklou.git]
/
includes
/
job
/
JobQueueDB.php
diff --git
a/includes/job/JobQueueDB.php
b/includes/job/JobQueueDB.php
index
e23ff0d
..
4d0f294
100644
(file)
--- a/
includes/job/JobQueueDB.php
+++ b/
includes/job/JobQueueDB.php
@@
-49,15
+49,19
@@
class JobQueueDB extends JobQueue {
return false;
}
return false;
}
- $found = $this->getSlaveDB()->selectField(
- 'job', '1', array( 'job_cmd' => $this->type ), __METHOD__
+ $found = $this->getSlaveDB()->selectField(
// unclaimed job
+ 'job', '1', array( 'job_cmd' => $this->type
, 'job_token' => ''
), __METHOD__
);
$wgMemc->add( $key, $found ? 'false' : 'true', self::CACHE_TTL );
);
$wgMemc->add( $key, $found ? 'false' : 'true', self::CACHE_TTL );
+ return (bool)$found;
}
/**
* @see JobQueue::doBatchPush()
}
/**
* @see JobQueue::doBatchPush()
+ * @param array $jobs
+ * @param $flags
+ * @throws DBError|Exception
* @return bool
*/
protected function doBatchPush( array $jobs, $flags ) {
* @return bool
*/
protected function doBatchPush( array $jobs, $flags ) {
@@
-366,6
+370,8
@@
class JobQueueDB extends JobQueue {
/**
* @see JobQueue::doAck()
/**
* @see JobQueue::doAck()
+ * @param Job $job
+ * @throws MWException
* @return Job|bool
*/
protected function doAck( Job $job ) {
* @return Job|bool
*/
protected function doAck( Job $job ) {
@@
-385,6
+391,8
@@
class JobQueueDB extends JobQueue {
/**
* @see JobQueue::doDeduplicateRootJob()
/**
* @see JobQueue::doDeduplicateRootJob()
+ * @param Job $job
+ * @throws MWException
* @return bool
*/
protected function doDeduplicateRootJob( Job $job ) {
* @return bool
*/
protected function doDeduplicateRootJob( Job $job ) {