Skip to content

Commit

Permalink
purger: strip link sytax from entry template
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Jan 1, 2024
1 parent 879f040 commit 991ae28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eventstream-router/routes/purger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default class Purger extends Route {
this.log(`[V] Failed to purge titles ${purgeParams.titles}`);
this.log(`[E] Failed to purge batch of ${purgeParams.titles.length} pages`);
this.log(e);
await bot.sleep(500);
}
}

Expand Down Expand Up @@ -113,7 +114,8 @@ class PurgeEntry {
forceLinkUpdate: boolean
forceRecursiveLinkUpdate: boolean
constructor(entry: Template) {
this.page = entry.getParam(1).value;
// strip link syntax from page name, maybe generated due to database report
this.page = entry.getParam(1).value.replace(/^\s*\[\[(.*?)\]\]\s*$/, '$1');
this.intervalDays = parseInt(entry.getParam('interval')?.value);

// any non-empty value represents true!
Expand Down

0 comments on commit 991ae28

Please sign in to comment.