Compare commits
3 Commits
379e972ec1
...
7ae3614f17
Author | SHA1 | Date |
---|---|---|
projectmoon | 7ae3614f17 | |
projectmoon | 6de1ac2922 | |
projectmoon | 5096ed1f1a |
|
@ -0,0 +1,5 @@
|
||||||
|
TRIGGER_API_KEY=tr_dev_f9kjPUxxfZO79OSjy1su
|
||||||
|
TRIGGER_API_URL=https://api.trigger.dev
|
||||||
|
NEXT_PUBLIC_TRIGGER_PUBLIC_API_KEY=pk_dev_0wewTNYuGo93XkoHaU9s
|
||||||
|
NEXT_PUBLIC_SUPABASE_URL=https://yexfstvjfxhursmqcqcu.supabase.co
|
||||||
|
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InlleGZzdHZqZnhodXJzbXFjcWN1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTI2ODg2OTMsImV4cCI6MjAyODI2NDY5M30.Mq1aKeO_SlwS-kEdsSn7VhHxHxNx1eeejd6jnBC7VJw
|
|
@ -6,7 +6,7 @@ const supabase = new SupabaseManagement({
|
||||||
id: "jokullbase-sanity-check",
|
id: "jokullbase-sanity-check",
|
||||||
});
|
});
|
||||||
|
|
||||||
const db = supabase.db<Database>(process.env.NEXT_PUBLIC_SUPABASE_URL!);
|
const db = supabase.db<Database>(process.env.NEXT_PUBLIC_SUPABASE_URL || "");
|
||||||
|
|
||||||
client.defineJob({
|
client.defineJob({
|
||||||
id: "on-new-todos",
|
id: "on-new-todos",
|
||||||
|
|
|
@ -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