Improve timezone handling, db models convert naive/timezone-aware

This commit is contained in:
2026-01-24 02:27:57 +01:00
parent 07e37e525c
commit b97eb0404c
4 changed files with 89 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
import logging
import threading
from . import utc_now
from . import now_utc
from .models import Hostname, User
from datetime import timedelta
@@ -18,7 +18,7 @@ def cleanup_expired(app):
Returns:
Number of expired hostnames processed.
"""
now = utc_now()
now = now_utc()
expired_count = 0
for hostname in Hostname.select().join(User).where(