Merge "Add support for PHP7 random_bytes in favor of mcrypt_create_iv"
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueRedis.php
index cbde5e4..c2c9d66 100644 (file)
@@ -254,6 +254,7 @@ class JobQueueRedis extends JobQueue {
                        $args[] = (string)$this->serialize( $item );
                }
                static $script =
+               /** @lang Lua */
 <<<LUA
                local kUnclaimed, kSha1ById, kIdBySha1, kDelayed, kData, kQwJobs = unpack(KEYS)
                -- First argument is the queue ID
@@ -343,6 +344,7 @@ LUA;
         */
        protected function popAndAcquireBlob( RedisConnRef $conn ) {
                static $script =
+               /** @lang Lua */
 <<<LUA
                local kUnclaimed, kSha1ById, kIdBySha1, kClaimed, kAttempts, kData = unpack(KEYS)
                local rTime = unpack(ARGV)
@@ -390,6 +392,7 @@ LUA;
                $conn = $this->getConnection();
                try {
                        static $script =
+                       /** @lang Lua */
 <<<LUA
                        local kClaimed, kAttempts, kData = unpack(KEYS)
                        local id = unpack(ARGV)
@@ -790,9 +793,9 @@ LUA;
        private function getGlobalKey( $name ) {
                $parts = [ 'global', 'jobqueue', $name ];
                foreach ( $parts as $part ) {
-                   if ( !preg_match( '/[a-zA-Z0-9_-]+/', $part ) ) {
-                       throw new InvalidArgumentException( "Key part characters are out of range." );
-                   }
+                       if ( !preg_match( '/[a-zA-Z0-9_-]+/', $part ) ) {
+                               throw new InvalidArgumentException( "Key part characters are out of range." );
+                       }
                }
 
                return implode( ':', $parts );