]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.cache: reset all-authors and all-tags also.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 9 Jan 2022 02:54:12 +0000 (18:54 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 9 Jan 2022 02:54:12 +0000 (18:54 -0800)
basis/vocabs/cache/cache.factor

index 847b7fc9eb25bb8aa8d46d3d58ee4bb4d3e4a436..7a09dc4a8a2e8bd138616ee356947a7266a28576 100644 (file)
@@ -5,17 +5,22 @@ vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.refresh
 words ;
 IN: vocabs.cache
 
-: reset-cache ( vocab -- )
+: reset-vocab-cache ( vocab -- )
     vocab-name
     [ root-cache get delete-at ]
     [
         \ vocab-file-lines "memoize" word-prop swap
         '[ drop first vocab-name _ = ] assoc-reject! drop
-    ] bi
+    ] bi ;
+
+: reset-disk-cache ( -- )
     \ all-disk-vocabs-recursive reset-memoized
     \ all-authors reset-memoized
     \ all-tags reset-memoized ;
 
+: reset-cache ( vocab -- )
+    reset-vocab-cache reset-disk-cache ;
+
 SINGLETON: cache-observer
 
 <PRIVATE
@@ -26,9 +31,8 @@ SINGLETON: cache-observer
 PRIVATE>
 
 M: cache-observer vocab-changed
-    drop dup forgot-vocab?
-    [ reset-cache ]
-    [ drop \ all-disk-vocabs-recursive reset-memoized ] if ;
+    drop dup forgot-vocab? [ reset-vocab-cache ] [ drop ] if
+    reset-disk-cache ;
 
 [
     f changed-vocabs set-global