Refactor: Update ban expiration logic

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 12:06:15 +00:00
parent 8c6726c9f2
commit 5bdab42211

View File

@@ -0,0 +1,15 @@
-- Enable pg_cron extension if not already enabled
CREATE EXTENSION IF NOT EXISTS pg_cron;
-- Schedule the process-expired-bans function to run every hour
SELECT cron.schedule(
'process-expired-bans',
'0 * * * *', -- Every hour at minute 0
$$
SELECT net.http_post(
url := 'https://ydvtmnrszybqnbcqbdcy.supabase.co/functions/v1/process-expired-bans',
headers := '{"Content-Type": "application/json", "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InlkdnRtbnJzenlicW5iY3FiZGN5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTgzMjYzNTYsImV4cCI6MjA3MzkwMjM1Nn0.DM3oyapd_omP5ZzIlrT0H9qBsiQBxBRgw2tYuqgXKX4"}'::jsonb,
body := '{}'::jsonb
) as request_id;
$$
);