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 "Revision: mark getRaw*() methods as deprecated"
[lhc/web/wiklou.git]
/
includes
/
jobqueue
/
JobQueueRedis.php
diff --git
a/includes/jobqueue/JobQueueRedis.php
b/includes/jobqueue/JobQueueRedis.php
index
3ac5cf4
..
abfdc8c
100644
(file)
--- a/
includes/jobqueue/JobQueueRedis.php
+++ b/
includes/jobqueue/JobQueueRedis.php
@@
-91,6
+91,7
@@
class JobQueueRedis extends JobQueue {
$this->compression = isset( $params['compression'] ) ? $params['compression'] : 'none';
$this->redisPool = RedisConnectionPool::singleton( $params['redisConfig'] );
$this->daemonized = !empty( $params['daemonized'] );
$this->compression = isset( $params['compression'] ) ? $params['compression'] : 'none';
$this->redisPool = RedisConnectionPool::singleton( $params['redisConfig'] );
$this->daemonized = !empty( $params['daemonized'] );
+ $this->checkDelay = true; // always enabled
}
protected function supportedOrders() {
}
protected function supportedOrders() {
@@
-152,9
+153,6
@@
class JobQueueRedis extends JobQueue {
* @throws JobQueueError
*/
protected function doGetDelayedCount() {
* @throws JobQueueError
*/
protected function doGetDelayedCount() {
- if ( !$this->checkDelay ) {
- return 0; // no delayed jobs
- }
$conn = $this->getConnection();
try {
return $conn->zSize( $this->getQueueKey( 'z-delayed' ) );
$conn = $this->getConnection();
try {
return $conn->zSize( $this->getQueueKey( 'z-delayed' ) );
@@
-295,7
+293,7
@@
LUA;
// Push ready delayed jobs into the queue every 10 jobs to spread the load.
// This is also done as a periodic task, but we don't want too much done at once.
// Push ready delayed jobs into the queue every 10 jobs to spread the load.
// This is also done as a periodic task, but we don't want too much done at once.
- if (
$this->checkDelay
&& mt_rand( 0, 9 ) == 0 ) {
+ if (
!$this->daemonized
&& mt_rand( 0, 9 ) == 0 ) {
$this->recyclePruneAndUndelayJobs();
}
$this->recyclePruneAndUndelayJobs();
}
@@
-614,7
+612,6
@@
LUA;
if attempts < ARGV[3] then
-- Claim expired and retries left: re-enqueue the job
redis.call('lPush',kUnclaimed,id)
if attempts < ARGV[3] then
-- Claim expired and retries left: re-enqueue the job
redis.call('lPush',kUnclaimed,id)
- redis.call('hIncrBy',kAttempts,id,1)
released = released + 1
else
-- Claim expired and no retries left: mark the job as dead
released = released + 1
else
-- Claim expired and no retries left: mark the job as dead
@@
-679,13
+676,10
@@
LUA;
if ( $this->daemonized ) {
return array(); // managed in the runner loop
}
if ( $this->daemonized ) {
return array(); // managed in the runner loop
}
- $periods = array( 3
600 ); // standard cleanup (useful on config change)
+ $periods = array( 3
00 ); // 5 min; delayed/stale jobs
if ( $this->claimTTL > 0 ) {
$periods[] = ceil( $this->claimTTL / 2 ); // halved to avoid bad timing
}
if ( $this->claimTTL > 0 ) {
$periods[] = ceil( $this->claimTTL / 2 ); // halved to avoid bad timing
}
- if ( $this->checkDelay ) {
- $periods[] = 300; // 5 minutes
- }
$period = min( $periods );
$period = max( $period, 30 ); // sanity
$period = min( $periods );
$period = max( $period, 30 ); // sanity