Mail box and OCR done

This commit is contained in:
2026-01-22 20:56:35 +05:30
parent 2148c4a61c
commit d662aea7e4
16 changed files with 644 additions and 14 deletions

14
backend/scheduler.py Normal file
View File

@@ -0,0 +1,14 @@
from apscheduler.schedulers.background import BackgroundScheduler
from mail_service import fetch_and_store_emails
scheduler = BackgroundScheduler()
def start_scheduler():
# Add job to run every 10 seconds
scheduler.add_job(fetch_and_store_emails, 'interval', seconds=10, id='mail_sync_job', replace_existing=True)
scheduler.start()
print("Mail Scheduler Started (Interval: 10s)")
def stop_scheduler():
scheduler.shutdown()
print("Mail Scheduler Stopped")