mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
fix(live): cache the oversized-track 502 like other upstream errors (#722)
Keep the new 502, but store it in the 60 s cache as the proxy already does for 404/429: /tracks/all costs OpenSky credits, so an oversized track must not be re-downloaded on every reselect. Update the regression test and credit the fix in CHANGELOG. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
0d58d6e1c4
commit
3a23dc393d
3 files changed
+15
-19
No files matched your search
@@ -55,9 +55,9 @@ export function trackBackfillProxies() {
|
||||
} else {
|
||||
body = text;
|
||||
}
|
||||
if (!tooLarge) {
|
||||
cachePut(key, { at: Date.now(), status, body });
|
||||
}
|
||||
// Cache the 502 like any upstream error: /tracks/all costs OpenSky
|
||||
// credits, so a retry inside the window must not re-download the body.
|
||||
cachePut(key, { at: Date.now(), status, body });
|
||||
res.statusCode = status;
|
||||
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
|
||||
Reference in new issue
Block a user