Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/cursor/src/data/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,15 @@ export async function getStuckScans() {
const supabase = await createClient();
const fifteenMinutesAgo = new Date(Date.now() - 15 * 60 * 1000).toISOString();

// A scan counts as stuck 15 minutes after the row last changed, the same
// test the recover-stuck-scans cron and the MCP rescan tool apply. Every
// status write bumps updated_at through the plugins_set_updated_at trigger,
// so a fresh re-scan of an old plugin is not stuck until that time passes.
const { data, error } = await supabase
.from("plugins")
.select("*, plugin_components(*)")
.or(
`scan_status.eq.error,and(scan_status.in.(pending,scanning),created_at.lt.${fifteenMinutesAgo})`,
`scan_status.eq.error,and(scan_status.in.(pending,scanning),updated_at.lt.${fifteenMinutesAgo})`,
)
.order("created_at", { ascending: false })
.limit(200);
Expand Down