diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/nar-herder.in | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index bbfaeea..a969910 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -55,6 +55,7 @@ ((guix build utils) #:select (dump-port)) (nar-herder utils) (nar-herder database) + (nar-herder recent-changes) (nar-herder storage) (nar-herder mirror) (nar-herder server)) @@ -115,6 +116,12 @@ (cons (string->symbol sym) rest))) result))) + (option '("recent-changes-limit") #t #f + (lambda (opt name arg result) + (alist-cons 'recent-changes-limit + (string->number arg) + (alist-delete 'recent-changes-limit result)))) + (option '("mirror") #t #f (lambda (opt name arg result) (alist-cons 'mirror @@ -125,7 +132,8 @@ '((port . 8080) (host . "0.0.0.0") - (storage-limit . "none"))) + (storage-limit . "none") + (recent-changes-limit . 32768))) (define (parse-options options defaults args) (args-fold @@ -276,6 +284,12 @@ "dumping database...\n") (dump-database database (assq-ref opts 'database-dump))) + (start-recent-change-removal-and-database-dump-thread + database + (assq-ref opts 'database-dump) + (* 24 3600) ; 24 hours + (assq-ref opts 'recent-changes-limit)) + (and=> (assq-ref opts 'mirror) (lambda (mirror) (start-fetch-changes-thread database mirror) |