chore(platform): satisfy runtime lint
Some checks failed
CD Pipeline / select-latest-carrier (push) Successful in 50s
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m21s
CD Pipeline / revalidate-deploy-carrier (push) Has been skipped
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / revalidate-post-deploy-carrier (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
Your Name
2026-07-22 18:33:00 +08:00
parent eae8293ca8
commit dbe83d9c03
2 changed files with 5 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ from __future__ import annotations
import hashlib
import json
from datetime import datetime, timedelta, timezone
from datetime import UTC, datetime, timedelta
from typing import Any
from uuid import UUID
@@ -32,7 +32,7 @@ from src.db.awooop_models import (
AwoooPRunStepJournal,
)
from src.db.base import get_db_context
from src.services.run_state_machine import LEASE_TTL_SECONDS, transition
from src.services.run_state_machine import transition
from src.services.runtime_correlation import (
canonical_traceparent,
correlation_readback_for_run,
@@ -205,7 +205,7 @@ async def create_run(
trace_id = correlation.trace_id
# AwoooPRunState timestamps use PostgreSQL TIMESTAMP WITHOUT TIME ZONE.
# Normalize UTC before binding so asyncpg does not reject an aware value.
timeout_at = datetime.now(timezone.utc).replace(tzinfo=None) + timedelta(
timeout_at = datetime.now(UTC).replace(tzinfo=None) + timedelta(
seconds=timeout_seconds
)

View File

@@ -75,10 +75,10 @@ def canonical_traceparent(run_id: UUID) -> str:
"""Derive a stable W3C traceparent from one durable run identifier."""
trace_hex = hashlib.sha256(
f"awooop-runtime-trace:{run_id}".encode("utf-8")
f"awooop-runtime-trace:{run_id}".encode()
).hexdigest()[:32]
span_hex = hashlib.sha256(
f"awooop-runtime-root-span:{run_id}".encode("utf-8")
f"awooop-runtime-root-span:{run_id}".encode()
).hexdigest()[:16]
return f"00-{trace_hex}-{span_hex}-01"