MCPcopy Index your code
hub / github.com/cursor/community-plugins / readNextPluginScan

Function readNextPluginScan

apps/cursor/src/lib/plugins/queue.ts:31–50  ·  view source on GitHub ↗
(
  vtSeconds: number,
)

Source from the content-addressed store, hash-verified

29}
30
31export async function readNextPluginScan(
32 vtSeconds: number,
33): Promise<PluginScanQueueRow | null> {
34 const supabase = await createAdminClient();
35 const { data, error } = await supabase
36 // biome-ignore lint/suspicious/noExplicitAny: pgmq_public is not in the generated types
37 .schema("pgmq_public" as any)
38 .rpc("read", {
39 queue_name: PLUGIN_SCAN_QUEUE,
40 sleep_seconds: vtSeconds,
41 n: 1,
42 });
43
44 if (error) {
45 throw new Error(`pgmq_public.read failed: ${error.message}`);
46 }
47
48 const rows = (data ?? []) as PluginScanQueueRow[];
49 return rows[0] ?? null;
50}
51
52export async function archivePluginScan(messageId: number): Promise<void> {
53 const supabase = await createAdminClient();

Callers 1

GETFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected