main
Deploy Iddaai Backend / build-and-deploy (push) Successful in 29s

This commit is contained in:
2026-05-04 18:00:40 +03:00
parent 145a8b336b
commit 27e96da31d
22 changed files with 571 additions and 169 deletions
+6 -4
View File
@@ -70,8 +70,7 @@ export class AiEngineClient {
this.maxRetries = options.maxRetries ?? 2;
this.retryDelayMs = options.retryDelayMs ?? 750;
this.circuitBreakerThreshold = options.circuitBreakerThreshold ?? 3;
this.circuitBreakerCooldownMs =
options.circuitBreakerCooldownMs ?? 30000;
this.circuitBreakerCooldownMs = options.circuitBreakerCooldownMs ?? 30000;
this.axiosClient = axios.create({
baseURL: options.baseUrl,
@@ -113,7 +112,9 @@ export class AiEngineClient {
};
}
private async request<T>(config: AiEngineRequestConfig): Promise<AxiosResponse<T>> {
private async request<T>(
config: AiEngineRequestConfig,
): Promise<AxiosResponse<T>> {
this.ensureCircuitAvailable();
const retries = this.resolveRetryCount(config);
@@ -162,7 +163,8 @@ export class AiEngineClient {
}
const remainingCooldown =
this.circuitBreakerCooldownMs - (Date.now() - (this.circuitOpenedAt ?? 0));
this.circuitBreakerCooldownMs -
(Date.now() - (this.circuitOpenedAt ?? 0));
if (remainingCooldown > 0) {
throw new AiEngineRequestError("AI engine circuit breaker is open", {
+2
View File
@@ -81,6 +81,7 @@ export const LIVE_STATUS_VALUES_FOR_DB = [
"Playing",
"Half Time",
"liveGame",
"minutes",
];
export const LIVE_STATE_VALUES_FOR_DB = [
@@ -109,6 +110,7 @@ export const FINISHED_STATUS_VALUES_FOR_DB = [
"postGame",
"posted",
"Posted",
"state",
];
export const FINISHED_STATE_VALUES_FOR_DB = [
+1 -4
View File
@@ -14,10 +14,7 @@ function extractDateParts(date: Date, timeZone: string) {
return { year, month, day };
}
export function getDateStringInTimeZone(
date: Date,
timeZone: string,
): string {
export function getDateStringInTimeZone(date: Date, timeZone: string): string {
const { year, month, day } = extractDateParts(date, timeZone);
return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
}