SupabaseS
Supabase4mo ago
Pondia

Cron do schedule but never execute

Hello,

The job are well scheduled but never executed.

I have followed this guide https://supabase.com/docs/guides/troubleshooting/pgcron-debugging-guide-n1KTaz but everything is fine regarding the cron scheduler.

job_run_details table remain empty.


CREATE EXTENSION IF NOT EXISTS pg_cron;

GRANT usage ON SCHEMA cron TO postgres;
GRANT all privileges ON ALL TABLES IN SCHEMA cron TO postgres;


On the SQL editor

SELECT cron.schedule(
    'job_in_1_minutes',
    TO_CHAR(NOW() + interval '1 minutes', 'MI HH24 DD MM') || ' *',
    $$SELECT now()$$ 
);


SELECT cron.schedule(
    'job_in_2_minutes',
    TO_CHAR(NOW() + interval '2 minutes', 'MI HH24 DD MM') || ' *',
    $$SELECT now()$$ 
);


SELECT cron.schedule(
    'job_in_5_minutes',
    TO_CHAR(NOW() + interval '5 minutes', 'MI HH24 DD MM') || ' *',
    $$SELECT now()$$  
);
Was this page helpful?