aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-10-09 21:29:58 +0100
committerChristopher Baines <mail@cbaines.net>2023-10-09 22:19:02 +0100
commit10bad53ad57e92dbc3c6207c251f0af1148e8ffc (patch)
treecf42c97b823461457da74db873f2a968c3060e19 /scripts
parent9bb8f84741bdd82b638e3a7a84280687d889fc04 (diff)
downloaddata-service-10bad53ad57e92dbc3c6207c251f0af1148e8ffc.tar
data-service-10bad53ad57e92dbc3c6207c251f0af1148e8ffc.tar.gz
Support polling git repositories for new branches/revisions
This is mostly a workaround for the occasional problems with the guix-commits mailing list, as it can break and then the data service doesn't learn about new revisions until the problem is fixed. I think it's still a generally good feature though, and allows deploying the data service without it consuming emails to learn about new revisions, and is a step towards integrating some kind of way of notifying the data service to poll.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix-data-service.in26
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/guix-data-service.in b/scripts/guix-data-service.in
index 1a41bd4..dc6b432 100644
--- a/scripts/guix-data-service.in
+++ b/scripts/guix-data-service.in
@@ -37,6 +37,8 @@
(guix-data-service config)
(guix-data-service database)
(guix-data-service substitutes)
+ (guix-data-service poll-git-repository)
+ (guix-data-service model git-repository)
(guix-data-service model guix-revision-package-derivation)
(guix-data-service web server)
(guix-data-service web controller)
@@ -204,12 +206,24 @@
(start-substitute-query-threads)
- (when (assoc-ref opts 'update-database)
- (call-with-new-thread
- (lambda ()
- (run-sqitch)
-
- (atomic-box-set! startup-completed #t))))
+ (call-with-new-thread
+ (lambda ()
+ (run-sqitch)
+
+ (for-each
+ (lambda (git-repository-details)
+ (when (fifth git-repository-details)
+ (simple-format #t "starting thread to poll ~A (~A)\n"
+ (second git-repository-details)
+ (third git-repository-details))
+
+ (start-thread-to-poll-git-repository
+ (first git-repository-details))))
+ (with-postgresql-connection
+ "poll-startup"
+ all-git-repositories))
+
+ (atomic-box-set! startup-completed #t)))
;; Provide some visual space between the startup output and the
;; server starting