fix datetime diff with timezone issue for workflow metrics log (#1714)

This commit is contained in:
Shuchang Zheng 2025-02-04 20:40:23 +08:00 committed by GitHub
parent 430c6b7851
commit e2d3d7fec5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -515,7 +515,7 @@ class WorkflowService:
)
# Track workflow run duration when completed
duration_seconds = (datetime.now(UTC) - workflow_run.created_at).total_seconds()
duration_seconds = (datetime.now(UTC) - workflow_run.created_at.replace(tzinfo=UTC)).total_seconds()
LOG.info(
"Workflow run duration metrics",
workflow_run_id=workflow_run_id,