Skip to content
Snippets Groups Projects
Unverified Commit 6838ec2e authored by Mathieu Othacehe's avatar Mathieu Othacehe
Browse files

database: Prevent division by zero.

* src/cuirass/database.scm (db-get-build-percentage): Prevent division by zero.
parent 158dd2bd
No related branches found
No related tags found
No related merge requests found
......@@ -676,7 +676,7 @@ WHERE job_name = " job-name "AND specification = " specification
SELECT LEAST(duration::float/last_duration * 100, 100)::int AS percentage FROM
(SELECT (extract(epoch from now())::int - starttime) as duration,
last_build.duration AS last_duration FROM builds,
(SELECT (stoptime - starttime) AS duration FROM Builds
(SELECT GREATEST((stoptime - starttime), 1) AS duration FROM Builds
WHERE job_name IN
(SELECT job_name from Builds WHERE id = " build-id ")
AND status = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment