Skip to content

Commit 721f908

Browse files
committed
fix: use nanos for runtime run ordering
1 parent 75d1cf1 commit 721f908

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/orchestrator/src/cortexpilot_orch/services/control_plane_read_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,17 @@ def _last_event_ts(run_id: str) -> str:
178178
return value
179179
return ""
180180

181-
def _run_sort_ts(run_dir: Path, manifest_record: dict[str, Any]) -> float:
181+
def _run_sort_ts(run_dir: Path, manifest_record: dict[str, Any]) -> int:
182182
manifest_path = run_dir / "manifest.json"
183183
if manifest_path.exists():
184-
return manifest_path.stat().st_mtime
184+
return manifest_path.stat().st_mtime_ns
185185
created_at = _as_text(manifest_record.get("created_at"))
186186
if created_at:
187187
try:
188-
return _parse_iso_ts(created_at).timestamp()
188+
return int(_parse_iso_ts(created_at).timestamp() * 1_000_000_000)
189189
except Exception:
190190
pass
191-
return run_dir.stat().st_mtime
191+
return run_dir.stat().st_mtime_ns
192192

193193
def _list_runs_runtime() -> list[dict[str, Any]]:
194194
results: list[dict[str, Any]] = []

0 commit comments

Comments
 (0)