Commit be58f02 Merge #337 `[frontend] fix graphs - some pending builds were not shown`

1 file Merged and Committed by clime 4 days ago
 1 @@ -167,9 +167,11 @@
 2                           build_chroot.ended_on > :start
 3                           OR build_chroot.ended_on IS NULL
 4                       )
 5 -                     AND NOT ((build.submitted_on NOT BETWEEN :start and :end)
 6 -                         AND (build_chroot.started_on NOT BETWEEN :start AND :end)
 7 -                         AND (build.submitted_on >= :start OR build_chroot.started_on <= :end)
 8 +                     AND ((build.submitted_on BETWEEN :start and :end)
 9 +                         OR (build_chroot.started_on BETWEEN :start AND :end)
10 +                         OR (build.submitted_on < :start
11 +                             AND (build_chroot.started_on > :end
12 +                                 OR (build_chroot.status = :status AND NOT build.canceled)))
13                       )
14               """)
15   
16 @@ -187,7 +189,8 @@
17                       )
18                   """)
19   
20 -             res_pending = db.engine.execute(query_pending, start=step_start, end=step_end)
21 +             res_pending = db.engine.execute(query_pending, start=step_start, end=step_end,
22 +                                             status=helpers.StatusEnum('pending'))
23               res_running = db.engine.execute(query_running, start=step_start, end=step_end,
24                                               status=helpers.StatusEnum('running'))
25