Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueRedis.php
index d4a5334..a356e84 100644 (file)
@@ -72,11 +72,6 @@ class JobQueueRedis extends JobQueue {
        /** @var string Compression method to use */
        protected $compression;
 
-       const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed (7 days)
-
-       /** @var string Key to prefix the queue keys with (used for testing) */
-       protected $key;
-
        /**
         * @param array $params Possible keys:
         *   - redisConfig : An array of parameters to RedisConnectionPool::__construct().
@@ -393,12 +388,17 @@ LUA;
                        static $script =
 <<<LUA
                        local kClaimed, kAttempts, kData = unpack(KEYS)
-                       local uuid = unpack(ARGV)
+                       local id = unpack(ARGV)
                        -- Unmark the job as claimed
-                       redis.call('zRem',kClaimed,uuid)
-                       redis.call('hDel',kAttempts,uuid)
+                       local removed = redis.call('zRem',kClaimed,id)
+                       -- Check if the job was recycled
+                       if removed == 0 then
+                               return 0
+                       end
+                       -- Delete the retry data
+                       redis.call('hDel',kAttempts,id)
                        -- Delete the job data itself
-                       return redis.call('hDel',kData,uuid)
+                       return redis.call('hDel',kData,id)
 LUA;
                        $res = $conn->luaEval( $script,
                                [