Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

490 B
Raw Blame
CREATE OR REPLACE FUNCTION util.sweep_embedding_queue()
 RETURNS void
 LANGUAGE plpgsql
 SECURITY DEFINER
 SET search_path TO 'public', 'pgmq', 'extensions'
AS $function$
BEGIN
  -- Only visible messages count: rows hidden by a read's visibility timeout
  -- are already being drained.
  IF EXISTS (
    SELECT 1 FROM pgmq.q_embedding_jobs WHERE vt <= clock_timestamp()
  ) THEN
    PERFORM util.send_inngest_event('carbon/embedding-queue.process', '{}'::jsonb);
  END IF;
END;
$function$;