Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 6, 2023
2 parents e6e9b59 + 1c33359 commit b951a15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2981,11 +2981,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Session/Handlers/RedisHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in a negated boolean, int given\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Session/Handlers/RedisHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Accessing offset \'HTTP_X_REQUESTED_WITH\' directly on \\$_SERVER is discouraged\\.$#',
'count' => 2,
Expand Down
1 change: 1 addition & 0 deletions system/Cache/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public function getMetaData(string $key)
if ($value !== null) {
$time = Time::now()->getTimestamp();
$ttl = $this->redis->ttl(static::validateKey($key, $this->prefix));
assert(is_int($ttl));

return [
'expire' => $ttl > 0 ? $time + $ttl : null,
Expand Down
5 changes: 4 additions & 1 deletion system/Session/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ protected function lockSession(string $sessionID): bool
$attempt = 0;

do {
if (($ttl = $this->redis->ttl($lockKey)) > 0) {
$ttl = $this->redis->ttl($lockKey);
assert(is_int($ttl));

if ($ttl > 0) {
sleep(1);

continue;
Expand Down

0 comments on commit b951a15

Please sign in to comment.