()
| 523 | } |
| 524 | |
| 525 | export async function getStuckScans() { |
| 526 | const supabase = await createClient(); |
| 527 | const fifteenMinutesAgo = new Date(Date.now() - 15 * 60 * 1000).toISOString(); |
| 528 | |
| 529 | const { data, error } = await supabase |
| 530 | .from("plugins") |
| 531 | .select("*, plugin_components(*)") |
| 532 | .or( |
| 533 | `scan_status.eq.error,and(scan_status.in.(pending,scanning),created_at.lt.${fifteenMinutesAgo})`, |
| 534 | ) |
| 535 | .order("created_at", { ascending: false }) |
| 536 | .limit(200); |
| 537 | |
| 538 | return { data: data as PluginRow[] | null, error }; |
| 539 | } |
| 540 | |
| 541 | export async function getStarredPlugins(userId: string) { |
| 542 | "use cache"; |
no test coverage detected