From d36d9a916302b36648dc97c27edc0ccaf9ce459e Mon Sep 17 00:00:00 2001 From: Amal Shaji Date: Thu, 25 Apr 2024 20:01:40 +0530 Subject: [PATCH] fix beat logging (#44) --- admin/src/portr_admin/beats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/src/portr_admin/beats.py b/admin/src/portr_admin/beats.py index dc5c4cd8..1c2b25c8 100644 --- a/admin/src/portr_admin/beats.py +++ b/admin/src/portr_admin/beats.py @@ -3,16 +3,16 @@ from portr_admin.models.connection import Connection, ConnectionStatus import logging -logger = logging.getLogger("fastapi") +logger = logging.getLogger("uvicorn.info") async def clear_expired_sessions(): logger.info("Clearing expired sessions") - await Session.filter(expires_at__lte=datetime.utcnow()).delete() + await Session.filter(expires_at__lte=datetime.now(UTC)).delete() async def clear_unclaimed_connections(): - logger.info(f"{datetime.now(UTC)} Clearing unclaimed connections") + logger.info("Clearing unclaimed connections") await Connection.filter( status=ConnectionStatus.reserved.value, created_at__lte=datetime.now(UTC) - timedelta(seconds=10),