aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-03-15 15:54:34 +0000
committerChristopher Baines <mail@cbaines.net>2024-03-15 15:54:34 +0000
commit676713e9d943ad2e912a7faad1b01522f9f7884b (patch)
tree54b927dfbe6e8c51921dcb2628628b086476c8b6 /scripts
parent75c0cb3c1d9d1327a0c1bba2d5e1cd282780fbbf (diff)
downloadnar-herder-676713e9d943ad2e912a7faad1b01522f9f7884b.tar
nar-herder-676713e9d943ad2e912a7faad1b01522f9f7884b.tar.gz
Add more TTL options
I'm really not sure about this caching stuff, but these options should provide the flexibility to change the TTLs the nar-herder advertises gracefully.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index cfa4fe7..e81da92 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -219,6 +219,38 @@
(exit 1))
(alist-cons 'narinfo-ttl (time-second duration)
result))))
+ (option '("new-ttl") #t #f
+ (lambda (opt name arg result)
+ (let ((duration (string->duration arg)))
+ (unless duration
+ (simple-format (current-error-port)
+ "~A: invalid duration\n"
+ arg)
+ (exit 1))
+ (alist-cons 'new-narinfo-ttl (time-second duration)
+ result))))
+ (option '("cached-compressions-ttl") #t #f
+ (lambda (opt name arg result)
+ (let ((duration (string->duration arg)))
+ (unless duration
+ (simple-format (current-error-port)
+ "~A: invalid duration\n"
+ arg)
+ (exit 1))
+ (alist-cons 'cached-compressions-narinfo-ttl
+ (time-second duration)
+ result))))
+ (option '("new-cached-compressions-ttl") #t #f
+ (lambda (opt name arg result)
+ (let ((duration (string->duration arg)))
+ (unless duration
+ (simple-format (current-error-port)
+ "~A: invalid duration\n"
+ arg)
+ (exit 1))
+ (alist-cons 'new-cached-compressions-narinfo-ttl
+ (time-second duration)
+ result))))
(option '("negative-ttl") #t #f
(lambda (opt name arg result)
(let ((duration (string->duration arg)))