Skip to content

Commit 1fbe44b

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: (37 commits) fix dumped markup improve amqp connection issues [Serializer] [ObjectNormalizer] Filter int when using FILTER_BOOL Fix #53778 Issue 59387-2: make check with prefix more robust [PropertyInfo] Add missing test fix tests [Security][Validators] Review translations. [validator] Updated Dutch translation [FrameworkBundle] Fix wiring ConsoleProfilerListener [HttpKernel] Fix link to php doc [Lock] Make sure RedisStore will also support Valkey [Validator] Update sr_Cyrl 120:This value is not a valid slug. [Validator] Update sr_Latn 120:This value is not a valid slug. 6.4 Missing translations for Italian (it) #59419 tests(notifier): avoid failing SNS test with local AWS configuration Fix typo ratio comment chore: PropertyAccess - fix typo in DocBlock [Validator] Missing translations for Brazilian Portuguese (pt_BR) fix(dependency-injection): reset env vars with kernel.reset ...
2 parents 6c37d02 + 4f6e8b0 commit 1fbe44b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Store/RedisStore.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class RedisStore implements SharedLockStoreInterface
2929
{
3030
use ExpiringStoreTrait;
3131

32-
private const NO_SCRIPT_ERROR_MESSAGE = 'NOSCRIPT No matching script. Please use EVAL.';
32+
private const NO_SCRIPT_ERROR_MESSAGE_PREFIX = 'NOSCRIPT';
3333

3434
private bool $supportTime;
3535

@@ -234,7 +234,7 @@ private function evaluate(string $script, string $resource, array $args): mixed
234234
$this->redis->clearLastError();
235235

236236
$result = $this->redis->evalSha($scriptSha, array_merge([$resource], $args), 1);
237-
if (self::NO_SCRIPT_ERROR_MESSAGE === $err = $this->redis->getLastError()) {
237+
if (null !== ($err = $this->redis->getLastError()) && str_starts_with($err, self::NO_SCRIPT_ERROR_MESSAGE_PREFIX)) {
238238
$this->redis->clearLastError();
239239

240240
if ($this->redis instanceof \RedisCluster) {
@@ -263,7 +263,7 @@ private function evaluate(string $script, string $resource, array $args): mixed
263263
$client = $this->redis->_instance($this->redis->_target($resource));
264264
$client->clearLastError();
265265
$result = $client->evalSha($scriptSha, array_merge([$resource], $args), 1);
266-
if (self::NO_SCRIPT_ERROR_MESSAGE === $err = $client->getLastError()) {
266+
if (null !== ($err = $this->redis->getLastError()) && str_starts_with($err, self::NO_SCRIPT_ERROR_MESSAGE_PREFIX)) {
267267
$client->clearLastError();
268268

269269
$client->script('LOAD', $script);
@@ -285,7 +285,7 @@ private function evaluate(string $script, string $resource, array $args): mixed
285285
\assert($this->redis instanceof \Predis\ClientInterface);
286286

287287
$result = $this->redis->evalSha($scriptSha, 1, $resource, ...$args);
288-
if ($result instanceof Error && self::NO_SCRIPT_ERROR_MESSAGE === $result->getMessage()) {
288+
if ($result instanceof Error && str_starts_with($result->getMessage(), self::NO_SCRIPT_ERROR_MESSAGE_PREFIX)) {
289289
$result = $this->redis->script('LOAD', $script);
290290
if ($result instanceof Error) {
291291
throw new LockStorageException($result->getMessage());

0 commit comments

Comments
 (0)