guix-commits
[Top][All Lists]
Advanced

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

04/06: Make with-postgresql-connection work with multiple values


From: Christopher Baines
Subject: 04/06: Make with-postgresql-connection work with multiple values
Date: Fri, 2 Oct 2020 15:15:40 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 71afa939816a3f7d53cce91d00fc1110125f18fe
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Oct 2 20:11:07 2020 +0100

    Make with-postgresql-connection work with multiple values
---
 guix-data-service/database.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm
index 60115ad..2ac26c4 100644
--- a/guix-data-service/database.scm
+++ b/guix-data-service/database.scm
@@ -65,9 +65,12 @@
     (with-throw-handler
       #t
       (lambda ()
-        (let ((result (f conn)))
-          (pg-conn-finish conn)
-          result))
+        (call-with-values
+            (lambda ()
+              (f conn))
+          (lambda vals
+            (pg-conn-finish conn)
+            (apply values vals))))
       (lambda (key . args)
         (pg-conn-finish conn)))))
 



reply via email to

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