added wss tools 7

This commit is contained in:
2026-06-18 19:44:23 +03:30
parent 017ab348c7
commit c15136c5e7
4 changed files with 125 additions and 9 deletions
+12
View File
@@ -33,6 +33,18 @@ class LivePriceCacheService
public function put(array $body): array
{
$cached = Cache::get(self::FULL_RESPONSE_KEY);
$cachedBody = is_array($cached['body'] ?? null) ? $cached['body'] : null;
if ($cachedBody !== null && PriceBroadcastService::lastPriceIdentity($cachedBody) === PriceBroadcastService::lastPriceIdentity($body)) {
Cache::put(self::FULL_RESPONSE_KEY, [
'body' => $cachedBody,
'stored_at' => now(),
], now()->addSeconds(self::TTL_SECONDS + 5));
return $cachedBody;
}
Cache::put(self::FULL_RESPONSE_KEY, [
'body' => $body,
'stored_at' => now(),