Files
org-parking/run_notifications.py
Stefano Manfredi c74a0ed350 Initial commit: Parking Manager
Features:
- Manager-centric parking spot management
- Fair assignment algorithm (parking/presence ratio)
- Presence tracking calendar
- Closing days (specific & weekly recurring)
- Guarantees and exclusions
- Authelia/LLDAP integration for SSO

Stack:
- FastAPI backend
- SQLite database
- Vanilla JS frontend
- Docker deployment
2025-11-26 23:37:50 +00:00

33 lines
860 B
Python

#!/usr/bin/env python3
"""
Notification Scheduler Script
Run this script via cron every 5 minutes:
*/5 * * * * cd /path/to/app && .venv/bin/python run_notifications.py
This will:
- Send presence reminders on Thursday at 12:00 (repeat daily until compiled)
- Send weekly parking summaries on Friday at 12:00
- Send daily parking reminders at user-configured times
- Process queued parking change notifications
"""
import sys
from database.connection import SessionLocal
from services.notifications import run_scheduled_notifications
def main():
db = SessionLocal()
try:
print("Running scheduled notifications...")
run_scheduled_notifications(db)
print("Done.")
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
finally:
db.close()
if __name__ == "__main__":
main()