We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93db70e commit 97b3b20Copy full SHA for 97b3b20
1 file changed
bin/validate-links.mts
@@ -34,6 +34,18 @@ for await (const cacheFile of cacheWalker) {
34
35
console.log(`Found ${cachedKeys.size} cached links!`);
36
37
+// randomly purge 10% of cache so we continuously check part of past links
38
+// this might help us catch any changed links
39
+let purgedKeys = 0;
40
+for (const cachedKey of cachedKeys) {
41
+ if (Math.random() < 0.1) {
42
+ cachedKeys.delete(cachedKey);
43
+ purgedKeys++;
44
+ }
45
+}
46
+
47
+console.log(`Randomly purged ${purgedKeys} links from cache!`);
48
49
const wikiLinks = new Set<string>();
50
const imageLinks = new Set<string>();
51
0 commit comments