[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/09: Switch to spawn for running sqitch
From: |
Christopher Baines |
Subject: |
06/09: Switch to spawn for running sqitch |
Date: |
Tue, 2 Apr 2024 08:23:56 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit 1dc293c5705efcfe51305d05f92142b9de52af1f
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Tue Apr 2 12:02:07 2024 +0100
Switch to spawn for running sqitch
As system* seems to break sigaction picking up SIGINT.
---
guix-data-service/database.scm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm
index 0b5175a..8af53da 100644
--- a/guix-data-service/database.scm
+++ b/guix-data-service/database.scm
@@ -169,11 +169,12 @@
params)))))
(simple-format #t "running command: ~A\n"
(string-join command))
- (unless (zero? (apply system* command))
- (simple-format
- (current-error-port)
- "error: sqitch command failed\n")
- (exit 1))))))))
+ (let ((pid (spawn (%config 'sqitch) command)))
+ (unless (= 0 (status:exit-val (cdr (waitpid pid))))
+ (simple-format
+ (current-error-port)
+ "error: sqitch command failed\n")
+ (primitive-exit 1)))))))))
(define* (with-postgresql-connection name f #:key (statement-timeout #f))
(let ((conn (open-postgresql-connection name statement-timeout)))
- branch master updated (b4583bb -> 7f5f110), Christopher Baines, 2024/04/02
- 06/09: Switch to spawn for running sqitch,
Christopher Baines <=
- 07/09: Move sleep to start of spawn-port-monitoring-fiber, Christopher Baines, 2024/04/02
- 08/09: Guard against logging failing, Christopher Baines, 2024/04/02
- 05/09: Close unused PostgreSQL connections, Christopher Baines, 2024/04/02
- 01/09: Make changes for the guile-prometheus update, Christopher Baines, 2024/04/02
- 02/09: Stop using a inferior-package-derivations lock, Christopher Baines, 2024/04/02
- 04/09: Remove the per-thread PostgreSQL connection code, Christopher Baines, 2024/04/02
- 09/09: Add error handling for startup failures, Christopher Baines, 2024/04/02
- 03/09: Move backfilling in to the server module and use the connection pool, Christopher Baines, 2024/04/02