aboutsummaryrefslogtreecommitdiff
path: root/nar-herder/database.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-01-31 18:07:17 +0000
committerChristopher Baines <mail@cbaines.net>2023-01-31 18:07:17 +0000
commita849b429bbdd3a772a731544e9845dd0d0a7efc1 (patch)
tree75b1ea925252ba2778b499b6b4dca2138bf64e81 /nar-herder/database.scm
parente903e3a591222e316b425f10834b25522c917e55 (diff)
downloadnar-herder-a849b429bbdd3a772a731544e9845dd0d0a7efc1.tar
nar-herder-a849b429bbdd3a772a731544e9845dd0d0a7efc1.tar.gz
Remove cached narinfo file database entries when removing nars
Diffstat (limited to 'nar-herder/database.scm')
-rw-r--r--nar-herder/database.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/nar-herder/database.scm b/nar-herder/database.scm
index 49c0392..c9e61fe 100644
--- a/nar-herder/database.scm
+++ b/nar-herder/database.scm
@@ -732,6 +732,17 @@ DELETE FROM narinfo_tags WHERE narinfo_id = :narinfo_id"
(remove-narinfo-files db narinfo-id)
(remove-narinfo-references db narinfo-id)
(remove-tags db narinfo-id)
+
+ (for-each
+ (lambda (cached-details)
+ (database-remove-cached-narinfo-file
+ database
+ narinfo-id
+ (assq-ref cached-details 'compression)))
+ (database-select-cached-narinfo-files-by-narinfo-id
+ database
+ narinfo-id))
+
(remove-narinfo-record db narinfo-id)
#t))))