Fix rescheduling of other jobs
* also update schedule from every minute to every hour
This commit is contained in:
parent
90c563d921
commit
11fa9e4d10
@ -1,23 +1,17 @@
|
|||||||
-- add 'deleteUnusedImages' job to the prisma hack
|
-- add 'deleteUnusedImages' job
|
||||||
-- see migration 20230522153900_schedule_jobs
|
CREATE OR REPLACE FUNCTION create_delete_unused_images_job()
|
||||||
CREATE OR REPLACE FUNCTION create_scheduled_jobs()
|
|
||||||
RETURNS INTEGER
|
RETURNS INTEGER
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
AS $$
|
AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('trust', '0 2 * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('deleteUnusedImages', '0 * * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('auction', '* * * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('earn', '0 0 * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('streak', '15 0 * * *','America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('views', '0 0 * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('rankViews', '* * * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('rankViews', '* * * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO pgboss.schedule (name, cron, timezone) VALUES ('deleteUnusedImages', '* * * * *', 'America/Chicago') ON CONFLICT DO NOTHING;
|
|
||||||
return 0;
|
return 0;
|
||||||
EXCEPTION WHEN OTHERS THEN
|
EXCEPTION WHEN OTHERS THEN
|
||||||
return 0;
|
return 0;
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
SELECT create_scheduled_jobs();
|
SELECT create_delete_unused_images_job();
|
||||||
|
|
||||||
|
DROP FUNCTION create_delete_unused_images_job;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user