This service handles the automatic cleanup of expired OTPs in the JamAndFlow database.
- Create a
.envfile:
POSTGRES_USER=postgres
POSTGRES_PASSWORD=PassWord
POSTGRES_DB=JamAndFlow
POSTGRES_HOST=db
POSTGRES_PORT=5432
CLEANUP_INTERVAL_SECONDS=300 # 5 minutes- Build and run with Docker Compose:
docker compose up --buildPOSTGRES_USER: PostgreSQL usernamePOSTGRES_PASSWORD: PostgreSQL passwordPOSTGRES_DB: PostgreSQL database namePOSTGRES_HOST: PostgreSQL host (default:dbfor Docker Compose)POSTGRES_PORT: PostgreSQL port (default:5432)CLEANUP_INTERVAL_SECONDS: Interval between cleanup runs (default: 300 seconds / 5 minutes)
This service needs to be on the same network as your main JamAndFlow API:
# Create the network if it doesn't exist
docker network create jamandflows-network- Install dependencies:
pip install -r requirements.txt- Run locally:
python cleanup.py