completionId: cgen-2548a2347fd648b39b42f7a7a81d28b9
cgen-2548a2347fd648b39b42f7a7a81d28b9
This commit is contained in:
parent
0e676421be
commit
61d85e4924
1 changed files with 4 additions and 15 deletions
|
|
@ -33,21 +33,10 @@ export const aethexSocialService = {
|
|||
|
||||
async getFollowing(userId: string): Promise<string[]> {
|
||||
try {
|
||||
// Add timeout to prevent hanging
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(() => controller.abort(), 8000);
|
||||
|
||||
const { data, error } = await Promise.race([
|
||||
supabase
|
||||
.from("user_follows")
|
||||
.select("following_id")
|
||||
.eq("follower_id", userId),
|
||||
new Promise<any>((_, reject) =>
|
||||
setTimeout(() => reject(new Error("getFollowing timeout")), 7900),
|
||||
),
|
||||
]);
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
const { data, error } = await supabase
|
||||
.from("user_follows")
|
||||
.select("following_id")
|
||||
.eq("follower_id", userId);
|
||||
|
||||
if (error) {
|
||||
console.error(
|
||||
|
|
|
|||
Loading…
Reference in a new issue