Skip to content

Commit 65eb271

Browse files
committed
fix wrong odering of date in stats chart
1 parent 185f903 commit 65eb271

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/api/handlers/projects/jobs.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def get(self, project_id, job_id):
533533

534534
j = g.db.execute_one_dict("""
535535
SELECT id FROM job
536-
WHERE id = %s
536+
WHERE id = %s
537537
AND project_id = %s
538538
""", [job_id, project_id])
539539

@@ -636,14 +636,13 @@ def compact(s):
636636

637637
count = 1
638638
for count in range(1, c + 1):
639-
if not s:
640-
break
641-
642-
l = s.pop()
643-
r['mem'] += l['mem']
639+
l = s.pop(0)
640+
r['mem'] += max(r['mem'], l['mem'])
644641
r['cpu'] += l['cpu']
645642
r['date'] += l['date']
646643

644+
if not s:
645+
break
647646

648647
r['mem'] = r['mem'] / count
649648
r['cpu'] = r['cpu'] / count

0 commit comments

Comments
 (0)