Skip to content

Commit 25470e6

Browse files
fix: cron label, per-model field names, duration parser
- Cron schedule_label: include all 5 fields (was missing day_of_month, month_of_year) - Per-model table: rows_added→rows_inserted, rows_modified→rows_updated (match backend celery_tasks.py field names) - parseDurationMs: handle serializer format ("1m 30s", "45.0s", "800ms") with fallback to HH:MM:SS
1 parent 147e654 commit 25470e6

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

backend/backend/core/scheduler/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def run_stats(request, project_id, user_task_id):
652652
if periodic.crontab:
653653
schedule_type = "cron"
654654
c = periodic.crontab
655-
schedule_label = f"{c.minute} {c.hour} {c.day_of_week}"
655+
schedule_label = f"{c.minute} {c.hour} {c.day_of_month} {c.month_of_year} {c.day_of_week}"
656656
elif periodic.interval:
657657
schedule_type = "interval"
658658
schedule_label = f"Every {periodic.interval.every} {periodic.interval.period}"

frontend/src/ide/run-history/Runhistory.jsx

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,25 @@ const formatDurationMs = (ms) => {
6262
const parseDurationMs = (d) => {
6363
if (!d) return 0;
6464
if (typeof d === "number") return d;
65-
const p = d.split(":");
66-
if (p.length !== 3) return 0;
67-
return (
68-
(parseInt(p[0], 10) * 3600 + parseInt(p[1], 10) * 60 + parseFloat(p[2])) *
69-
1000
70-
);
65+
// Handle serializer format: "1m 30s", "45.0s", "800ms"
66+
const str = String(d);
67+
let ms = 0;
68+
const minMatch = str.match(/([\d.]+)\s*m(?!s)/);
69+
const secMatch = str.match(/([\d.]+)\s*s/);
70+
const msMatch = str.match(/([\d.]+)\s*ms/);
71+
if (msMatch) ms += parseFloat(msMatch[1]);
72+
if (secMatch) ms += parseFloat(secMatch[1]) * 1000;
73+
if (minMatch) ms += parseFloat(minMatch[1]) * 60000;
74+
if (ms > 0) return ms;
75+
// Fallback: HH:MM:SS format
76+
const p = str.split(":");
77+
if (p.length === 3) {
78+
return (
79+
(parseInt(p[0], 10) * 3600 + parseInt(p[1], 10) * 60 + parseFloat(p[2])) *
80+
1000
81+
);
82+
}
83+
return 0;
7184
};
7285

7386
/* ── Sparkline SVG — plots real duration data points ── */
@@ -701,8 +714,8 @@ const Runhistory = () => {
701714
},
702715
{
703716
title: "Added",
704-
dataIndex: "rows_added",
705-
key: "rows_added",
717+
dataIndex: "rows_inserted",
718+
key: "rows_inserted",
706719
width: 90,
707720
align: "right",
708721
render: (v) =>
@@ -722,8 +735,8 @@ const Runhistory = () => {
722735
},
723736
{
724737
title: "Modified",
725-
dataIndex: "rows_modified",
726-
key: "rows_modified",
738+
dataIndex: "rows_updated",
739+
key: "rows_updated",
727740
width: 90,
728741
align: "right",
729742
render: (v) =>

0 commit comments

Comments
 (0)