kin: auto-commit after pipeline
This commit is contained in:
parent
62f0ccc292
commit
d5818c64e4
1 changed files with 2 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ kin ps: one-shot list of all running pipelines with PID and current step.
|
|||
|
||||
import json
|
||||
import time
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from core import models
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ def _format_elapsed(dt_iso: str) -> str:
|
|||
# SQLite stores "YYYY-MM-DD HH:MM:SS"; fromisoformat requires 'T' in Python < 3.11
|
||||
normalized = dt_iso.replace(' ', 'T') if ' ' in dt_iso else dt_iso
|
||||
started = datetime.fromisoformat(normalized)
|
||||
total_secs = int((datetime.utcnow() - started).total_seconds())
|
||||
total_secs = int((datetime.now(timezone.utc).replace(tzinfo=None) - started).total_seconds())
|
||||
if total_secs < 0:
|
||||
total_secs = 0
|
||||
hours = total_secs // 3600
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue