guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: database: Prevent division by zero.


From: Mathieu Othacehe
Subject: branch master updated: database: Prevent division by zero.
Date: Sat, 30 Jan 2021 10:14:48 -0500

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix-cuirass.

The following commit(s) were added to refs/heads/master by this push:
     new 6838ec2  database: Prevent division by zero.
6838ec2 is described below

commit 6838ec2eac8eae2c3743fca76ad0cda87b4df5fb
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat Jan 30 16:14:04 2021 +0100

    database: Prevent division by zero.
    
    * src/cuirass/database.scm (db-get-build-percentage): Prevent division by 
zero.
---
 src/cuirass/database.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index d66db01..b0bc1eb 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]