# HG changeset patch # User Ludovic Chabant # Date 1490331568 25200 # Node ID 596e9ca2da866bc6dca762bba9edeb6e49f9b0b7 # Parent f4629148e72e5e55d95753988cff16ac567c4619 rmlists: Add `rmlists` command to invalidate cached page lists. diff -r f4629148e72e -r 596e9ca2da86 wikked/commands/manage.py --- a/wikked/commands/manage.py Wed Mar 22 18:35:31 2017 -0700 +++ b/wikked/commands/manage.py Thu Mar 23 21:59:28 2017 -0700 @@ -154,3 +154,21 @@ ctx.wiki.resolve( force=ctx.args.force, parallel=ctx.args.parallel) + + +@register_command +class RemoveAllListsCommand(WikkedCommand): + def __init__(self): + super().__init__() + self.name = 'rmlists' + self.description = ( + "Deletes all the cached page lists to force re-computing them " + "all. Page lists include things like the list of all orphan " + "or wanted pages.") + + def setupParser(self, parser): + pass + + def run(self, ctx): + ctx.wiki.db.removeAllPageLists() + logger.info("All page lists removed.")