Fix starting with an empty database
This commit is contained in:
parent
717b861d31
commit
c58ee6726b
3 changed files with 12 additions and 2 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-19)
|
#:use-module (srfi srfi-19)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (ice-9 atomic)
|
||||||
#:use-module (ice-9 threads)
|
#:use-module (ice-9 threads)
|
||||||
#:use-module (fibers)
|
#:use-module (fibers)
|
||||||
#:use-module (fibers channels)
|
#:use-module (fibers channels)
|
||||||
|
|
@ -149,7 +150,7 @@
|
||||||
(lambda (channel)
|
(lambda (channel)
|
||||||
(put-message channel (cons build-server-id build-ids)))))))
|
(put-message channel (cons build-server-id build-ids)))))))
|
||||||
|
|
||||||
(define (start-substitute-query-threads)
|
(define (start-substitute-query-threads startup-completed?)
|
||||||
(define channel
|
(define channel
|
||||||
(make-channel))
|
(make-channel))
|
||||||
|
|
||||||
|
|
@ -162,6 +163,9 @@
|
||||||
(set-thread-name "request substitute query"))
|
(set-thread-name "request substitute query"))
|
||||||
(const #t))
|
(const #t))
|
||||||
|
|
||||||
|
(while (not (atomic-box-ref startup-completed?))
|
||||||
|
(sleep 1))
|
||||||
|
|
||||||
(while #t
|
(while #t
|
||||||
(with-exception-handler
|
(with-exception-handler
|
||||||
(lambda (exn)
|
(lambda (exn)
|
||||||
|
|
@ -208,6 +212,9 @@
|
||||||
(set-thread-name "bulk substitute query"))
|
(set-thread-name "bulk substitute query"))
|
||||||
(const #t))
|
(const #t))
|
||||||
|
|
||||||
|
(while (not (atomic-box-ref startup-completed?))
|
||||||
|
(sleep 1))
|
||||||
|
|
||||||
(while #t
|
(while #t
|
||||||
(with-exception-handler
|
(with-exception-handler
|
||||||
(lambda (exn)
|
(lambda (exn)
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,9 @@ port. Also, the port used can be changed by passing the --port option.\n"
|
||||||
|
|
||||||
(spawn-fiber
|
(spawn-fiber
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
(while (not (check-startup-completed startup-completed))
|
||||||
|
(sleep 1))
|
||||||
|
|
||||||
(with-resource-from-pool (background-connection-pool) conn
|
(with-resource-from-pool (background-connection-pool) conn
|
||||||
(backfill-guix-revision-package-derivation-distribution-counts
|
(backfill-guix-revision-package-derivation-distribution-counts
|
||||||
conn)))
|
conn)))
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(simple-format port "~A\n" (getpid)))))
|
(simple-format port "~A\n" (getpid)))))
|
||||||
|
|
||||||
(start-substitute-query-threads)
|
(start-substitute-query-threads startup-completed)
|
||||||
|
|
||||||
(call-with-new-thread
|
(call-with-new-thread
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue