From 318f4072fadf984c287d35258048003f6f26aebd Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 11 Sep 2023 08:55:25 +0100 Subject: Use fibers for the recent changes removal thread --- scripts/nar-herder.in | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index e9d3150..0736592 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -610,15 +610,6 @@ (log-msg 'INFO "dumping database...") (dump-database database (assq-ref opts 'database-dump)))) - (start-recent-change-removal-and-database-dump-thread - database - (let ((filename (assq-ref opts 'database-dump))) - (if (string=? filename "disabled") - #f - filename)) - (* 24 3600) ; 24 hours - (assq-ref opts 'recent-changes-limit)) - (let ((finished? (make-condition))) (call-with-new-thread (lambda () @@ -629,6 +620,15 @@ (run-fibers (lambda () + (start-recent-change-removal-and-database-dump-fiber + database + (let ((filename (assq-ref opts 'database-dump))) + (if (string=? filename "disabled") + #f + filename)) + (* 24 3600) ; 24 hours + (assq-ref opts 'recent-changes-limit)) + (and=> (assq-ref opts 'mirror) (lambda (mirror) (start-fetch-changes-fiber database -- cgit v1.2.3