Fix cron jobs for prod
This commit is contained in:
parent
5096ed1f1a
commit
6de1ac2922
|
@ -0,0 +1,25 @@
|
||||||
|
select cron.unschedule(jobs.jobid) FROM cron.job jobs;
|
||||||
|
drop extension if exists pg_cron;
|
||||||
|
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;
|
||||||
|
|
||||||
|
-- restore the jobs
|
||||||
|
SELECT
|
||||||
|
cron.schedule(
|
||||||
|
'drop-old-chunks',
|
||||||
|
'*/10 * * * *',
|
||||||
|
$$
|
||||||
|
SELECT drop_chunks('raw_bus_positions', INTERVAL '24 hours');
|
||||||
|
$$
|
||||||
|
);
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
cron.schedule(
|
||||||
|
'download-bus-data',
|
||||||
|
'5 seconds',
|
||||||
|
$$
|
||||||
|
select gather_bus_data();
|
||||||
|
$$
|
||||||
|
);
|
Loading…
Reference in New Issue