Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Oct 25, 2021
1 parent 6670559 commit cece6c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WorkerLimiterLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function lock(string $name, int $max, ?float $timeout, ?string $po

return PoolManager::use($poolName ?? RedisManager::getDefaultPoolName(), function ($resource, RedisHandler $redis) use ($args, $numKeys) {
$redis->clearLastError();
$result = $redis->evalEx(<<<SCRIPT
$result = $redis->evalEx(<<<'SCRIPT'
local name = KEYS[1]
local max = ARGV[1]
local now = ARGV[2]
Expand Down Expand Up @@ -85,7 +85,7 @@ public static function unlock(string $name, int $workerId, ?string $poolName = n

return PoolManager::use($poolName ?? RedisManager::getDefaultPoolName(), function ($resource, RedisHandler $redis) use ($args, $numKeys) {
$redis->clearLastError();
$result = $redis->evalEx(<<<SCRIPT
$result = $redis->evalEx(<<<'SCRIPT'
local name = KEYS[1]
local id = ARGV[1]
local timeoutKey = name .. ':timeout'
Expand Down

0 comments on commit cece6c1

Please sign in to comment.