diff options
-rw-r--r-- | scripts/nar-herder.in | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 32a2afa..8ade7fb 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -278,16 +278,20 @@ (lambda (store-path) (log-msg 'INFO "removing " store-path) - ;; 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) - (make-metrics-registry #:namespace - "narherder") - (store-path-hash-part store-path)) + (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) + (make-metrics-registry #:namespace + "narherder") + (store-path-hash-part store-path))) + (log-msg + 'WARN "no --storage set, so just removing from the database")) (database-remove-narinfo database store-path)) (assq-ref opts 'arguments)))) |