Refactor: Remove circuit breaker system

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 15:02:17 +00:00
parent 116eaa2635
commit e08aacaff3
5 changed files with 2 additions and 383 deletions

View File

@@ -4,7 +4,6 @@
*/
import { logger } from './logger';
import { supabaseCircuitBreaker } from './circuitBreaker';
import { supabase } from './supabaseClient';
export interface RetryOptions {
@@ -216,10 +215,8 @@ export async function withRetry<T>(
for (let attempt = 0; attempt < config.maxAttempts; attempt++) {
try {
// Execute the function through circuit breaker
const result = await supabaseCircuitBreaker.execute(async () => {
return await fn();
});
// Execute the function directly
const result = await fn();
// Log successful retry if not first attempt
if (attempt > 0) {
@@ -233,15 +230,6 @@ export async function withRetry<T>(
} catch (error) {
lastError = error;
// Check if circuit breaker blocked the request
if (error instanceof Error && error.message.includes('Circuit breaker is OPEN')) {
logger.error('Circuit breaker prevented retry', {
attempt: attempt + 1,
circuitState: supabaseCircuitBreaker.getState()
});
throw error; // Don't retry if circuit is open
}
// Check if we should retry
const isLastAttempt = attempt === config.maxAttempts - 1;
const shouldRetry = config.shouldRetry(error);