Commit b053ed0
committed
fix: address PR review — sparkline order, periodic_task 500, N+1 queries, imports
- Sparkline: fetch newest 10 runs (order_by -end_time) then reverse for chart
- Fix HTTP 500 for unscheduled jobs: use captured `periodic` variable
instead of re-accessing task.periodic_task in response dict
- Batch user queries: single User.objects.filter(id__in=...) instead of
per-row User.objects.get() in get_triggered_by
- Use Window(RowNumber) for run_number instead of loading all run IDs
- Deduplicate parse_datetime import — moved to top-level1 parent e719d6d commit b053ed0
2 files changed
Lines changed: 39 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
22 | 39 | | |
23 | 40 | | |
24 | 41 | | |
| |||
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
49 | | - | |
50 | | - | |
| 66 | + | |
51 | 67 | | |
52 | | - | |
53 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
54 | 75 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 76 | + | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
61 | | - | |
| 80 | + | |
62 | 81 | | |
63 | 82 | | |
64 | 83 | | |
65 | 84 | | |
66 | 85 | | |
67 | | - | |
68 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
69 | 89 | | |
70 | 90 | | |
71 | 91 | | |
72 | 92 | | |
73 | | - | |
74 | | - | |
| 93 | + | |
75 | 94 | | |
76 | 95 | | |
77 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
632 | 633 | | |
633 | 634 | | |
634 | 635 | | |
635 | | - | |
| 636 | + | |
636 | 637 | | |
637 | | - | |
| 638 | + | |
| 639 | + | |
638 | 640 | | |
639 | 641 | | |
640 | 642 | | |
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
644 | 646 | | |
| 647 | + | |
645 | 648 | | |
646 | 649 | | |
647 | 650 | | |
| |||
653 | 656 | | |
654 | 657 | | |
655 | 658 | | |
656 | | - | |
| 659 | + | |
657 | 660 | | |
658 | 661 | | |
659 | 662 | | |
| |||
676 | 679 | | |
677 | 680 | | |
678 | 681 | | |
679 | | - | |
| 682 | + | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
| |||
714 | 717 | | |
715 | 718 | | |
716 | 719 | | |
717 | | - | |
718 | 720 | | |
719 | 721 | | |
720 | 722 | | |
721 | 723 | | |
722 | | - | |
723 | | - | |
| 724 | + | |
724 | 725 | | |
725 | 726 | | |
726 | 727 | | |
| |||
0 commit comments