Compare commits

..

3 Commits

Author SHA1 Message Date
projectmoon 7ae3614f17 Do not crash vercel deployment 2024-04-10 21:33:35 +02:00
projectmoon 6de1ac2922 Fix cron jobs for prod 2024-04-10 21:33:21 +02:00
projectmoon 5096ed1f1a env file? 2024-04-10 21:16:54 +02:00
3 changed files with 31 additions and 1 deletions

5
.env.local Normal file
View File

@ -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

View File

@ -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",

View File

@ -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();
$$
);