| 50 | } |
| 51 | |
| 52 | export async function archivePluginScan(messageId: number): Promise<void> { |
| 53 | const supabase = await createAdminClient(); |
| 54 | const { error } = await supabase |
| 55 | // biome-ignore lint/suspicious/noExplicitAny: pgmq_public is not in the generated types |
| 56 | .schema("pgmq_public" as any) |
| 57 | .rpc("archive", { |
| 58 | queue_name: PLUGIN_SCAN_QUEUE, |
| 59 | message_id: messageId, |
| 60 | }); |
| 61 | |
| 62 | if (error) { |
| 63 | throw new Error(`pgmq_public.archive failed: ${error.message}`); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | const DRAIN_PATH = "/api/queue/plugin-scans/drain"; |
| 68 | |