fix(lint): ruff auto-fix + lewooogo-core src 加入 git
- Python: ruff --fix 修復 280 個 lint 錯誤 - lewooogo-core: src/ 目錄未追蹤,導致 CI eslint 失敗 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ Features:
|
||||
import asyncio
|
||||
import ssl
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from enum import Enum
|
||||
from typing import Literal
|
||||
|
||||
@@ -94,7 +94,7 @@ class HostStatus:
|
||||
status: Literal["healthy", "degraded", "unhealthy", "unreachable"]
|
||||
services: list[ServiceStatus]
|
||||
metrics: HostMetrics | None = None
|
||||
last_check: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
last_check: datetime = field(default_factory=lambda: datetime.now(UTC))
|
||||
error: str | None = None
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ async def _tcp_probe(ip: str, port: int, timeout: float = 3.0) -> tuple[bool, fl
|
||||
await writer.wait_closed()
|
||||
return True, round(latency, 2), None
|
||||
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
return False, None, "timeout"
|
||||
except ConnectionRefusedError:
|
||||
return False, None, "connection refused"
|
||||
@@ -481,7 +481,7 @@ class HostAggregator:
|
||||
)
|
||||
|
||||
return AggregatedStatus(
|
||||
timestamp=datetime.now(timezone.utc),
|
||||
timestamp=datetime.now(UTC),
|
||||
environment=settings.ENVIRONMENT,
|
||||
mock_mode=False, # Always real mode
|
||||
overall_status=overall,
|
||||
|
||||
Reference in New Issue
Block a user