v3.1.1 - RC - more testing needed - Details in Changelog.md
Some checks failed
Docker Image - Webmail / build_self_hosted (push) Waiting to run
Docker Image - Webmail / build_github_hosted_fallback (push) Blocked by required conditions
Docker Image - DockFlare / build_self_hosted (push) Has been cancelled
Docker Image - Mail Manager / build_self_hosted (push) Has been cancelled
Docker Image - DockFlare / build_github_hosted_fallback (push) Has been cancelled
Docker Image - Mail Manager / build_github_hosted_fallback (push) Has been cancelled

This commit is contained in:
ChrispyBacon-dev 2026-04-24 23:32:33 +02:00
parent b3c0da2d75
commit 0fad7c592f
65 changed files with 5980 additions and 1619 deletions

View file

@ -5,7 +5,8 @@ import time
log = logging.getLogger(__name__)
_INTERVAL = 7 * 24 * 3600
_CLEANUP_INTERVAL = 7 * 24 * 3600
_ALIAS_EXPIRY_INTERVAL = 3600
def _run_cleanup():
@ -47,7 +48,7 @@ def _run_cleanup():
def _scheduler_loop():
while True:
time.sleep(_INTERVAL)
time.sleep(_CLEANUP_INTERVAL)
log.info("Scheduler: running push subscription cleanup")
try:
_run_cleanup()
@ -55,9 +56,23 @@ def _scheduler_loop():
log.exception("Scheduler: unhandled error in cleanup run")
def _alias_expiry_loop():
time.sleep(300)
while True:
try:
from app.core.alias_expiry import expire_aliases
expire_aliases()
except Exception:
log.exception("Scheduler: unhandled error in alias expiry run")
time.sleep(_ALIAS_EXPIRY_INTERVAL)
def start_scheduler():
if os.environ.get('DISABLE_SCHEDULER'):
return
t = threading.Thread(target=_scheduler_loop, daemon=True, name="push-cleanup-scheduler")
t.start()
log.info("Scheduler: push subscription cleanup scheduled every 7 days")
a = threading.Thread(target=_alias_expiry_loop, daemon=True, name="alias-expiry-scheduler")
a.start()
log.info("Scheduler: alias expiry scheduled every hour")