guix-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Ludovic Courtès
Date: Mon, 29 Jan 2018 12:07:18 -0500 (EST)

branch: master
commit 0bf61ef1ff4ec7c4e24d6315f9a24e55959ec594
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 29 15:23:51 2018 +0100

    http: Evaluate DB requests in 'non-blocking'.
    
    * src/cuirass/http.scm (handle-builds-request): Wrap 'db-get-builds'
    into 'non-blocking'.
---
 src/cuirass/http.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index b8a2996..9541844 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -67,8 +67,11 @@
 (define (handle-builds-request db filters)
   "Retrieve all builds matched by FILTERS in DB and convert them to hydra
   format."
-  (let ((builds (with-time-logging "builds request"
-                                   (db-get-builds db filters))))
+  ;; Since these requests can take several seconds (!), run them through
+  ;; 'non-blocking'.
+  (let ((builds (non-blocking
+                 (with-time-logging "builds request"
+                                    (db-get-builds db filters)))))
     (map build->hydra-build builds)))
 
 (define (request-parameters request)



reply via email to

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