Skip to content

Commit

Permalink
purger: use /Entry template
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Jan 1, 2024
1 parent d812883 commit 879f040
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions eventstream-router/routes/purger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,17 @@ export default class Purger extends Route {
async queuePurgeRequest(entries: Array<PurgeEntry>) {
// 4 permutations
[
entries.filter(e => e.forceLinkUpdate && e.forceRecursiveLinkUpdate),
entries.filter(e => e.forceRecursiveLinkUpdate),
entries.filter(e => e.forceLinkUpdate && !e.forceRecursiveLinkUpdate),
entries.filter(e => !e.forceLinkUpdate && !e.forceRecursiveLinkUpdate),
entries.filter(e => !e.forceLinkUpdate && e.forceRecursiveLinkUpdate),
].forEach(batch => {
const subBatches = arrayChunk(batch, 100);
subBatches.forEach(subBatch => {
this.purgeRequestQueue.push({
action: 'purge',
titles: subBatch.map(e => e.page),
forcelinkupdate: subBatch[0].forceLinkUpdate,
forcerecursivelinkupdate: subBatch[0].forceRecursiveLinkUpdate
forcerecursivelinkupdate: subBatch[0].forceRecursiveLinkUpdate,
});
});
});
Expand All @@ -92,7 +91,7 @@ export default class Purger extends Route {
async parseEntries() {
const text = (await bot.read(this.CONF_PAGE)).revisions[0].content;
const entries = bot.Wikitext.parseTemplates(text, {
namePredicate: name => name === '/purge'
namePredicate: name => name === '/Entry'
});
this.log(`[V] Parsed ${entries.length} titles from ${this.CONF_PAGE}`);

Expand Down

0 comments on commit 879f040

Please sign in to comment.