[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/08: Support setting a statement timeout
From: |
Christopher Baines |
Subject: |
01/08: Support setting a statement timeout |
Date: |
Fri, 24 Apr 2020 13:54:45 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit 0cc78b90aec0ccdd8740092a465753cc71bca704
Author: Christopher Baines <address@hidden>
AuthorDate: Fri Apr 24 08:59:32 2020 +0100
Support setting a statement timeout
To stop queries related to the web server that run for a long time.
---
guix-data-service/database.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm
index 455ce82..df4daac 100644
--- a/guix-data-service/database.scm
+++ b/guix-data-service/database.scm
@@ -34,7 +34,7 @@
(define pg-conn-finish
(@@ (squee) pg-conn-finish))
-(define* (with-postgresql-connection name f)
+(define* (with-postgresql-connection name f #:key (statement-timeout #f))
(define paramstring
(string-append
(or (getenv "GUIX_DATA_SERVICE_DATABASE_PARAMSTRING")
@@ -47,6 +47,11 @@
(let* ((conn (connect-to-postgres-paramstring
(or (getenv "GUIX_DATA_SERVICE_DATABASE_URI")
paramstring))))
+ (when statement-timeout
+ (exec-query
+ conn
+ (simple-format #f "SET statement_timeout = ~A"
+ statement-timeout)))
(with-throw-handler
#t
(lambda ()
- branch master updated (c61a8af -> 5af213a), Christopher Baines, 2020/04/24
- 01/08: Support setting a statement timeout,
Christopher Baines <=
- 02/08: Set a statement timeout of 60 seconds for web requests, Christopher Baines, 2020/04/24
- 03/08: Make it clearer that some things relate to package derivations, Christopher Baines, 2020/04/24
- 05/08: Implement the JSON response for the package derivations page, Christopher Baines, 2020/04/24
- 07/08: Add a JSON output for the revision channel instances, Christopher Baines, 2020/04/24
- 06/08: Fix the field names for the JSON representation of a branch, Christopher Baines, 2020/04/24
- 08/08: Include if data is available in the JSON response for a branch, Christopher Baines, 2020/04/24
- 04/08: Support controlling the fields returned for package derivations, Christopher Baines, 2020/04/24