This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
// Metro module 12698 (f12699).
import getCachedUseAltGateway_native from "./getCachedUseAltGateway.native";
const GATEWAY_ALT_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ALT_ENDPOINT;
let c8748_1 = getCachedUseAltGateway_native();
class AltGatewayTracker {
constructor() {
return {
__proto__: new.target.prototype,
failures: 0,
fallbackTripped: false
};
}
shouldUseAltGateway() {
const fallbackTripped = this.fallbackTripped;
return (fallbackTripped ? !fallbackTripped : GATEWAY_ALT_ENDPOINT != null) && c8748_1;
}
isAssignedToAltGateway() {
return GATEWAY_ALT_ENDPOINT != null && c8748_1;
}
getDidFallBack() {
return this.fallbackTripped;
}
getAltGatewayUrl() {
return this.shouldUseAltGateway() ? GATEWAY_ALT_ENDPOINT : null;
}
recordSuccess() {
this.failures = 0;
}
recordFailure() {
if (this.shouldUseAltGateway()) {
this.failures = this.failures + 1;
if (this.failures >= 3) {
this.fallbackTripped = true;
}
}
}
reset() {
this.failures = 0;
this.fallbackTripped = false;
}
}
export default AltGatewayTracker;