aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-09-11 15:42:48 +0100
committerChristopher Baines <mail@cbaines.net>2023-09-12 13:11:00 +0100
commit94888457b2d22782f2dbb3d406cc76d37c1bc170 (patch)
treece5c5e1c233ef970c712958a41f00b2b8825d52c
parent4cd601a887d4a2c21d929c02d87d33b9bedcf9f1 (diff)
downloadnar-herder-94888457b2d22782f2dbb3d406cc76d37c1bc170.tar
nar-herder-94888457b2d22782f2dbb3d406cc76d37c1bc170.tar.gz
Remove get-nar-files
As it doesn't scale well.
-rw-r--r--nar-herder/storage.scm26
-rw-r--r--scripts/nar-herder.in4
2 files changed, 0 insertions, 30 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index c53b106..b78d4ed 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -40,8 +40,6 @@
#:export (store-item-in-local-storage?
remove-nar-files-by-hash
- get-nar-files
-
check-storage
start-nar-removal-fiber
@@ -167,30 +165,6 @@
(unrecognised-files . ,(hash-map->list (lambda (key _) key)
files-hash)))))
-(define* (get-nar-files database storage-root metrics-registry
- #:key stored?)
- (let* ((index (index-storage database storage-root))
- (selected-files
- (filter
- (lambda (file)
- (eq? (assq-ref file 'stored?) stored?))
- (assq-ref index 'narinfo-files))))
-
- (let ((selected-files-count
- (length selected-files))
- (all-files-count
- (length (assq-ref index 'narinfo-files))))
-
- (update-nar-files-metric
- metrics-registry
- (list
- (cons (if stored? 'stored 'not-stored)
- selected-files-count)
- (cons (if stored? 'not-stored 'stored)
- (- all-files-count selected-files-count)))))
-
- selected-files))
-
(define* (fold-nar-files database storage-root metrics-registry
proc init
#:key stored?)
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index e55fb9b..5222864 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -397,10 +397,6 @@
(if (assq-ref opts 'storage)
(begin
- ;; Removing the files here isn't ideal, since the servers
- ;; metrics won't be updated until the next get-nar-files call,
- ;; but it avoids extra complexity in trying to have the server
- ;; delete the files.
(remove-nar-files-by-hash
database
(assq-ref opts 'storage)