Ship production optimization M1-M12.5A: queues, metrics, HTTP observability, and vector search reliability.
Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
This commit is contained in:
@@ -181,7 +181,29 @@ class OnlineVisitorRepository
|
||||
*/
|
||||
protected function readIndexMembers(): array
|
||||
{
|
||||
return array_map('strval', Redis::smembers(self::INDEX_KEY));
|
||||
$members = [];
|
||||
$cursor = '0';
|
||||
$limit = max(1, (int) config('traffic.online_visitors.index_read_limit', 2000));
|
||||
|
||||
do {
|
||||
$result = Redis::sscan(self::INDEX_KEY, (int) $cursor, ['count' => 200]);
|
||||
|
||||
if (! is_array($result) || count($result) < 2) {
|
||||
break;
|
||||
}
|
||||
|
||||
$cursor = (string) $result[0];
|
||||
|
||||
foreach ($result[1] as $member) {
|
||||
$members[] = (string) $member;
|
||||
|
||||
if (count($members) >= $limit) {
|
||||
return $members;
|
||||
}
|
||||
}
|
||||
} while ($cursor !== '0');
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user