website refactor
This commit is contained in:
@@ -31,7 +31,7 @@ export class ApiConnectionMonitor extends EventEmitter {
|
||||
private isChecking = false;
|
||||
private checkInterval: NodeJS.Timeout | null = null;
|
||||
private healthCheckEndpoint: string;
|
||||
private readonly CHECK_INTERVAL = 30000; // 30 seconds
|
||||
private readonly CHECK_INTERVAL = 300000; // 5 minutes
|
||||
private readonly DEGRADATION_THRESHOLD = 0.7; // 70% failure rate
|
||||
|
||||
private constructor(healthCheckEndpoint: string = '/health') {
|
||||
|
||||
@@ -47,7 +47,7 @@ export class BaseApiClient {
|
||||
};
|
||||
|
||||
// Start monitoring connection health
|
||||
this.connectionMonitor.startMonitoring();
|
||||
// this.connectionMonitor.startMonitoring();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface RetryConfig {
|
||||
}
|
||||
|
||||
export const DEFAULT_RETRY_CONFIG: RetryConfig = {
|
||||
maxRetries: 3,
|
||||
maxRetries: 1,
|
||||
baseDelay: 1000,
|
||||
maxDelay: 10000,
|
||||
backoffMultiplier: 2,
|
||||
|
||||
@@ -28,7 +28,10 @@ export class DriversApiClient extends BaseApiClient {
|
||||
|
||||
/** Get current driver (based on session) */
|
||||
getCurrent(): Promise<GetDriverOutputDTO | null> {
|
||||
return this.get<GetDriverOutputDTO | null>('/drivers/current', { allowUnauthenticated: true });
|
||||
return this.get<GetDriverOutputDTO | null>('/drivers/current', {
|
||||
allowUnauthenticated: true,
|
||||
retry: false
|
||||
});
|
||||
}
|
||||
|
||||
/** Get driver registration status for a specific race */
|
||||
|
||||
@@ -46,12 +46,12 @@ function parseRaceDTOArray(value: unknown): RaceDTO[] {
|
||||
export class LeaguesApiClient extends BaseApiClient {
|
||||
/** Get all leagues with capacity information */
|
||||
getAllWithCapacity(): Promise<AllLeaguesWithCapacityDTO> {
|
||||
return this.get<AllLeaguesWithCapacityDTO>('/leagues/all-with-capacity');
|
||||
return this.get<AllLeaguesWithCapacityDTO>('/leagues/all-with-capacity', { retry: false });
|
||||
}
|
||||
|
||||
/** Get all leagues with capacity + scoring summary (for leagues page filters) */
|
||||
getAllWithCapacityAndScoring(): Promise<AllLeaguesWithCapacityAndScoringDTO> {
|
||||
return this.get<AllLeaguesWithCapacityAndScoringDTO>('/leagues/all-with-capacity-and-scoring');
|
||||
return this.get<AllLeaguesWithCapacityAndScoringDTO>('/leagues/all-with-capacity-and-scoring', { retry: false });
|
||||
}
|
||||
|
||||
/** Get total number of leagues */
|
||||
|
||||
Reference in New Issue
Block a user