Remove on-premise Supabase code
\ Removes code related to on-premise Supabase connections, ensuring the application uses the cloud version.
This commit is contained in:
@@ -6,7 +6,7 @@ import { deleteTransactionFromSupabase } from '../../supabaseUtils';
|
||||
import { toast } from '@/hooks/useToast.wrapper';
|
||||
|
||||
/**
|
||||
* 스토리지 및 Supabase 삭제 처리 - 완전히 개선된 버전
|
||||
* 스토리지 및 Supabase 삭제 처리 - Supabase Cloud에 최적화된 버전
|
||||
*/
|
||||
export const handleDeleteStorage = (
|
||||
updatedTransactions: Transaction[],
|
||||
@@ -34,22 +34,24 @@ export const handleDeleteStorage = (
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. Supabase 삭제는 백그라운드로 처리 (결과는 기다리지 않음)
|
||||
// 2. Supabase Cloud 삭제는 백그라운드로 처리 (결과는 기다리지 않음)
|
||||
const deleteFromSupabase = async () => {
|
||||
try {
|
||||
const timeoutPromise = new Promise<void>((_, reject) => {
|
||||
setTimeout(() => reject(new Error('Supabase 삭제 타임아웃')), 3000);
|
||||
});
|
||||
|
||||
// Promise.race로 타임아웃 처리
|
||||
// Supabase Cloud에 최적화된 삭제 요청
|
||||
await Promise.race([
|
||||
deleteTransactionFromSupabase(user, id),
|
||||
timeoutPromise
|
||||
new Promise((_, reject) => setTimeout(() => reject(new Error('Supabase 삭제 타임아웃')), 5000))
|
||||
]);
|
||||
|
||||
console.log('Supabase 삭제 성공:', id);
|
||||
} catch (error) {
|
||||
console.error('Supabase 삭제 실패 (백그라운드 작업):', error);
|
||||
// 삭제 실패 알림 (선택적)
|
||||
toast({
|
||||
title: "동기화 문제",
|
||||
description: "클라우드 데이터 삭제에 실패했습니다. 나중에 다시 시도합니다.",
|
||||
variant: "default"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user