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.
This commit is contained in:
Christopher Baines 2023-10-09 21:29:58 +01:00
parent 9bb8f84741
commit 10bad53ad5
14 changed files with 328 additions and 53 deletions

View file

@ -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)
(call-with-new-thread
(lambda ()
(run-sqitch)
(atomic-box-set! startup-completed #t))))
(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