refactor: Update utc to UTC

This commit is contained in:
Matthias
2025-07-04 08:56:42 +02:00
parent 5f59e1435e
commit 37cc949d94
15 changed files with 49 additions and 50 deletions

View File

@@ -102,7 +102,7 @@ class WebSocketChannel:
self._send_times.append(total_time)
self._calc_send_limit()
except asyncio.TimeoutError:
except TimeoutError:
logger.info(f"Connection for {self} timed out, disconnecting")
raise
@@ -201,8 +201,8 @@ class WebSocketChannel:
try:
await task
except (
TimeoutError,
asyncio.CancelledError,
asyncio.TimeoutError,
WebSocketDisconnect,
ConnectionClosed,
RuntimeError,

View File

@@ -5,7 +5,7 @@ This module contains class to define a RPC communications
import logging
from abc import abstractmethod
from collections.abc import Generator, Sequence
from datetime import date, datetime, timedelta, timezone
from datetime import UTC, date, datetime, timedelta
from typing import TYPE_CHECKING, Any
import psutil
@@ -375,7 +375,7 @@ class RPC:
"""
:param timeunit: Valid entries are 'days', 'weeks', 'months'
"""
start_date = datetime.now(timezone.utc).date()
start_date = datetime.now(UTC).date()
if timeunit == "weeks":
# weekly
start_date = start_date - timedelta(days=start_date.weekday()) # Monday
@@ -1259,7 +1259,7 @@ class RPC:
for lock in locks:
lock.active = False
lock.lock_end_time = datetime.now(timezone.utc)
lock.lock_end_time = datetime.now(UTC)
Trade.commit()