diff options
Diffstat (limited to 'guix-data-service')
-rw-r--r-- | guix-data-service/database.scm | 8 | ||||
-rw-r--r-- | guix-data-service/jobs/load-new-guix-revision.scm | 1 | ||||
-rw-r--r-- | guix-data-service/web/controller.scm | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm index ab6758b..acc6dea 100644 --- a/guix-data-service/database.scm +++ b/guix-data-service/database.scm @@ -24,10 +24,12 @@ (define pg-conn-finish (@@ (squee) pg-conn-finish)) -(define (with-postgresql-connection f) +(define* (with-postgresql-connection name f) (define paramstring - (or (getenv "GUIX_DATA_SERVICE_DATABASE_PARAMSTRING") - "dbname=guix_data_service user=guix_data_service")) + (string-append + (or (getenv "GUIX_DATA_SERVICE_DATABASE_PARAMSTRING") + "dbname=guix_data_service user=guix_data_service") + " application_name='guix-data-service " name "'")) (let* ((conn (connect-to-postgres-paramstring paramstring))) (with-throw-handler diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 4990208..8c53183 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -703,6 +703,7 @@ ORDER BY load_new_guix_revision_jobs.id DESC") (lambda () (let ((result (with-postgresql-connection + (simple-format #f "load-new-guix-revision ~A logging" id) (lambda (logging-conn) (insert-empty-log-entry logging-conn id) (let ((logging-port (log-port id logging-conn))) diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index 6cdcd8b..66bc893 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -568,6 +568,7 @@ #t (lambda () (with-postgresql-connection + "web healthcheck" (lambda (conn) (number? (string->number @@ -585,6 +586,7 @@ 500)))) (_ (with-postgresql-connection + "web" (lambda (conn) (controller-with-database-connection request method-and-path-components |