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
This commit is contained in:
32
run_notifications.py
Normal file
32
run_notifications.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user