1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 16:46:30 +02:00

fix(spotify): detect rate limiting (#4253)

This commit is contained in:
Dag
2024-09-03 07:02:37 +02:00
committed by GitHub
parent 3dc8b65a0b
commit 293d04f296
2 changed files with 47 additions and 25 deletions

View File

@@ -44,8 +44,8 @@ class CacheMiddleware implements Middleware
$response = $next($request);
if (in_array($response->getCode(), [403, 429, 500, 503])) {
// Cache these responses for about ~20 mins on average
$this->cache->set($cacheKey, $response, 60 * 15 + rand(1, 60 * 10));
// Cache these responses for about ~10 mins on average
$this->cache->set($cacheKey, $response, 60 * 5 + rand(1, 60 * 10));
}
// For 1% of requests, prune cache