mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 02:11:12 -05:00
Monitor rate limits progress
Implement monitor-rate-limits edge function to compare metrics against alert configurations, trigger notifications, and record alerts; update config and groundwork for admin UI integration.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
-- Fix security warning: Set search_path for rate limit alert function
|
||||
-- Drop trigger first, then function, then recreate with proper search_path
|
||||
|
||||
DROP TRIGGER IF EXISTS update_rate_limit_alert_config_updated_at ON public.rate_limit_alert_config;
|
||||
DROP FUNCTION IF EXISTS update_rate_limit_alert_config_updated_at();
|
||||
|
||||
CREATE OR REPLACE FUNCTION update_rate_limit_alert_config_updated_at()
|
||||
RETURNS TRIGGER
|
||||
LANGUAGE plpgsql
|
||||
SECURITY DEFINER
|
||||
SET search_path = public
|
||||
AS $$
|
||||
BEGIN
|
||||
NEW.updated_at = now();
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$;
|
||||
|
||||
CREATE TRIGGER update_rate_limit_alert_config_updated_at
|
||||
BEFORE UPDATE ON public.rate_limit_alert_config
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_rate_limit_alert_config_updated_at();
|
||||
Reference in New Issue
Block a user