mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 07:12:12 +03:00
Closes #3619
This commit is contained in:
committed by
GitHub
parent
8c7f37340c
commit
47155fa3a0
@@ -71,7 +71,12 @@ export async function GET() {
|
||||
lastProviderTs = requestTs;
|
||||
}
|
||||
|
||||
const errorTs = lastErrorAt ? Date.parse(lastErrorAt) : 0;
|
||||
// Only flag as errorProvider if the provider's MOST RECENT request was itself
|
||||
// a failure. A provider with a historical lastErrorAt but a recent success
|
||||
// (lastStatus 2xx/3xx) must not be shown as currently errored (#3619).
|
||||
const isCurrentlyInError =
|
||||
lastStatus !== null && (lastStatus < 200 || lastStatus >= 400);
|
||||
const errorTs = isCurrentlyInError && lastErrorAt ? Date.parse(lastErrorAt) : 0;
|
||||
if (Number.isFinite(errorTs) && errorTs > errorProviderTs) {
|
||||
errorProvider = provider;
|
||||
errorProviderTs = errorTs;
|
||||
|
||||
Reference in New Issue
Block a user