Skip to content

Commit

Permalink
Use 'script' instead of 'rawCommand'
Browse files Browse the repository at this point in the history
  • Loading branch information
dciprian-petrisor committed Oct 10, 2024
1 parent 7bac119 commit 66b90b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Symfony/Component/Lock/Store/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private function evaluate(string $script, string $resource, array $args): mixed
if (null !== ($err = $this->redis->getLastError()) && self::NO_SCRIPT_ERROR_MESSAGE === $err) {
$this->redis->clearLastError();

$this->redis->rawCommand('SCRIPT', 'LOAD', $script);
$this->redis->script('LOAD', $script);

if (null !== ($err = $this->redis->getLastError())) {
throw new LockStorageException($err);
Expand All @@ -260,7 +260,7 @@ private function evaluate(string $script, string $resource, array $args): mixed
if (null !== ($err = $client->getLastError()) && self::NO_SCRIPT_ERROR_MESSAGE === $err) {
$client->clearLastError();

$client->rawCommand('SCRIPT', 'LOAD', $script);
$client->script('LOAD', $script);

if (null !== ($err = $client->getLastError())) {
throw new LockStorageException($err);
Expand Down Expand Up @@ -288,8 +288,7 @@ private function evaluate(string $script, string $resource, array $args): mixed
}

try {
$loadScriptCommand = $this->redis->createCommand('SCRIPT', ['LOAD', $script]);
$this->redis->executeCommand($loadScriptCommand);
$this->redis->script('LOAD', $script);
} catch (ServerException $e) {
throw new LockStorageException($e->getMessage(), $e->getCode(), $e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Lock\Tests\Store;

use Symfony\Component\Lock\Key;
use Symfony\Component\Lock\Store\RedisStore;

/**
* @author Jérémy Derussé <[email protected]>
*
Expand Down

0 comments on commit 66b90b7

Please sign in to comment.