Skip to content

Commit

Permalink
fix beat logging (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
amalshaji committed Apr 25, 2024
1 parent 256e957 commit d36d9a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admin/src/portr_admin/beats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d36d9a9

Please sign in to comment.