Keyan c20a954cfc
This day on ... automated post (#1273)
* add this day posting job

* put in proper timezone

* make sure we're in central timezone

* schedule thisDay job
2024-07-23 10:35:15 -05:00

16 lines
381 B
PL/PgSQL

CREATE OR REPLACE FUNCTION schedule_this_day_job()
RETURNS INTEGER
LANGUAGE plpgsql
AS $$
DECLARE
BEGIN
INSERT INTO pgboss.schedule (name, cron, timezone)
VALUES ('thisDay', '0 5 * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
return 0;
EXCEPTION WHEN OTHERS THEN
return 0;
END;
$$;
SELECT schedule_this_day_job();
DROP FUNCTION IF EXISTS schedule_this_day_job;