mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
Split port traffic service and replace deprecated UTC/lifespan APIs.
Keep the public facade stable while moving device CRUD and sample/compare logic into focused modules, and use naive UTC via timeutil plus FastAPI lifespan. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6dc3946bc6
commit
a2f91f6ee2
12 changed files with 1171 additions and 1044 deletions
|
|
@ -14,6 +14,7 @@ from sqlalchemy.orm import Session
|
|||
from .config import settings
|
||||
from .db import SessionLocal
|
||||
from .models import UmeAlarmCurrent, UmeInventoryNE, UmeSyncJob
|
||||
from .timeutil import utcnow_naive
|
||||
from .runtime_task_messages import (
|
||||
RT_ALARMS_SYNC_IN_PROGRESS_SKIP,
|
||||
RT_KEEPALIVE_FAILED,
|
||||
|
|
@ -240,7 +241,7 @@ def _fail_stale_running_sync_jobs_on_startup() -> None:
|
|||
)
|
||||
if not rows:
|
||||
return
|
||||
now_naive = datetime.utcnow()
|
||||
now_naive = utcnow_naive()
|
||||
for row in rows:
|
||||
row.status = "failed"
|
||||
row.ended_at = now_naive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue