aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-02-08 14:48:25 +0100
committerChristopher Baines <mail@cbaines.net>2023-02-08 14:48:25 +0100
commit39cf2280bb87a2f177b4cb8334c5eb7ad95a0d17 (patch)
tree6819dff767025287c9015d09eed38d8d82b0d265 /scripts
parent0196b80508e1f12f539b58dea288bbe4bc5a033b (diff)
downloadnar-herder-39cf2280bb87a2f177b4cb8334c5eb7ad95a0d17.tar
nar-herder-39cf2280bb87a2f177b4cb8334c5eb7ad95a0d17.tar.gz
Allow disabling dumping the database
As this takes up quite a lot of space if the database is large.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index 32b467d..7524308 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -568,13 +568,19 @@
#:cached-compression-workers
(assq-ref opts 'cached-compression-workers)))))
- (when (not (file-exists? (assq-ref opts 'database-dump)))
- (log-msg 'INFO "dumping database...")
- (dump-database database (assq-ref opts 'database-dump)))
+ (if (string=? (assq-ref opts 'database-dump)
+ "disabled")
+ (log-msg 'INFO "database dump disabled")
+ (when (not (file-exists? (assq-ref opts 'database-dump)))
+ (log-msg 'INFO "dumping database...")
+ (dump-database database (assq-ref opts 'database-dump))))
(start-recent-change-removal-and-database-dump-thread
database
- (assq-ref opts 'database-dump)
+ (let ((filename (assq-ref opts 'database-dump)))
+ (if (string=? filename "disabled")
+ #f
+ filename))
(* 24 3600) ; 24 hours
(assq-ref opts 'recent-changes-limit))