diff options
Diffstat (limited to 'scripts/guix-data-service.in')
-rw-r--r-- | scripts/guix-data-service.in | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/scripts/guix-data-service.in b/scripts/guix-data-service.in index dc6b432..8a124ee 100644 --- a/scripts/guix-data-service.in +++ b/scripts/guix-data-service.in @@ -197,33 +197,33 @@ (lambda (port) (simple-format port "~A\n" (getpid))))) - (call-with-new-thread - (lambda () - (with-postgresql-connection-per-thread - "backfill" - (lambda () - (backfill-guix-revision-package-derivation-distribution-counts))))) - (start-substitute-query-threads) (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))) + (with-exception-handler + (lambda (exn) + (simple-format + (current-error-port) + "startup failed: ~A\n" exn) + (exit 1)) + (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 |