Use @lang tags for Lua scripts
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 25 Sep 2016 18:50:16 +0000 (11:50 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 25 Sep 2016 18:50:16 +0000 (11:50 -0700)
Change-Id: Ifdbff687539078b375330ebe3a1493b281e5c518

includes/jobqueue/JobQueueRedis.php
includes/libs/lockmanager/RedisLockManager.php
includes/poolcounter/PoolCounterRedis.php

index cbde5e4..25a271c 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)
index a9f5ca3..6001705 100644 (file)
@@ -98,6 +98,7 @@ class RedisLockManager extends QuorumLockManager {
 
                try {
                        static $script =
+                       /** @lang Lua */
 <<<LUA
                        local failed = {}
                        -- Load input params (e.g. session, ttl, time of request)
@@ -191,6 +192,7 @@ LUA;
 
                try {
                        static $script =
+                       /** @lang Lua */
 <<<LUA
                        local failed = {}
                        -- Load input params (e.g. session)
index 99556ed..5a15ddf 100644 (file)
@@ -155,6 +155,7 @@ class PoolCounterRedis extends PoolCounter {
 
                // @codingStandardsIgnoreStart Generic.Files.LineLength
                static $script =
+               /** @lang Lua */
 <<<LUA
                local kSlots,kSlotsNextRelease,kWakeup,kWaiting = unpack(KEYS)
                local rMaxWorkers,rExpiry,rSlot,rSlotTime,rAwakeAll,rTime = unpack(ARGV)
@@ -291,6 +292,7 @@ LUA;
         */
        protected function initAndPopPoolSlotList( RedisConnRef $conn, $now ) {
                static $script =
+               /** @lang Lua */
 <<<LUA
                local kSlots,kSlotsNextRelease,kSlotWaits = unpack(KEYS)
                local rMaxWorkers,rMaxQueue,rTimeout,rExpiry,rSess,rTime = unpack(ARGV)
@@ -359,6 +361,7 @@ LUA;
         */
        protected function registerAcquisitionTime( RedisConnRef $conn, $slot, $now ) {
                static $script =
+               /** @lang Lua */
 <<<LUA
                local kSlots,kSlotsNextRelease,kSlotWaits = unpack(KEYS)
                local rSlot,rExpiry,rSess,rTime = unpack(ARGV)