diff --git a/app/Console/Commands/CleanupRedis.php b/app/Console/Commands/CleanupRedis.php index 64a3ac259..93035e255 100644 --- a/app/Console/Commands/CleanupRedis.php +++ b/app/Console/Commands/CleanupRedis.php @@ -356,7 +356,13 @@ private function cleanupStuckJobs($redis, string $prefix, bool $dryRun, bool $is $now = time(); // Get all keys with the horizon prefix - $keys = $redis->keys('*'); + $cursor = 0; + $keys = []; + do { + $result = $redis->scan($cursor, ['MATCH' => '*', 'COUNT' => 100]); + $cursor = $result[0]; + $keys = array_merge($keys, $result[1]); + } while ($cursor !== 0); foreach ($keys as $key) { $keyWithoutPrefix = str_replace($prefix, '', $key);