Scheduled cleanup job that deletes old access logs based on billing plan retention settings.
This Edge Function enforces log retention policies by permanently deleting access logs older than the configured retention period for each container's billing plan. It calls the sgtm_delete_old_logs database function.
sgtm_delete_old_logs
POST /functions/v1/sgtm_access_logs_cleanup
Cron/internal - designed to run as a scheduled job via pg_cron.
billing_plans.log_retention_days
sgtm_access_logs
sgtm_container_subscriptions
billing_plans
Scheduled cleanup job that deletes old access logs based on billing plan retention settings.
Overview
This Edge Function enforces log retention policies by permanently deleting access logs older than the configured retention period for each container's billing plan. It calls the
sgtm_delete_old_logsdatabase function.Endpoint
POST /functions/v1/sgtm_access_logs_cleanupAuthentication
Cron/internal - designed to run as a scheduled job via pg_cron.
Behavior
sgtm_delete_old_logsRPC functionbilling_plans.log_retention_daysfor each containerTables Touched
sgtm_access_logs(delete via RPC)sgtm_container_subscriptions(read via RPC)billing_plans(read via RPC)Notes