Files
TakuyaYagam1 13f936bee9 chore: import MCTF services
- Added all seven issued service trees without omissions.
- Preserved the supplied runtime configuration, binaries, and assets.
2026-11-29 12:25:29 +03:00

17 lines
450 B
Bash
Executable File

#!/bin/sh
set -eu
: "${PGHOST:=postgres}"
: "${PGUSER:=postgres}"
: "${PGDATABASE:=delamain}"
: "${PGPASSWORD:=postgres}"
: "${CLEAN_OLDER_THAN:=6 minutes}"
: "${CLEAN_EVERY:=60}"
export PGHOST PGUSER PGDATABASE PGPASSWORD
while true; do
sleep "$CLEAN_EVERY"
psql -c "DELETE FROM trips WHERE created_at < now() - interval '${CLEAN_OLDER_THAN}'"
psql -c "DELETE FROM users WHERE created_at < now() - interval '${CLEAN_OLDER_THAN}'"
done