Skip to content
Snippets Groups Projects
Commit fc070da7 authored by HeJ's avatar HeJ Committed by Roang
Browse files

housekeeping: allow skipping schedule and/or wiki imports

parent 49bc07a5
No related branches found
No related tags found
No related merge requests found
...@@ -15,13 +15,8 @@ class Command(BaseCommand): ...@@ -15,13 +15,8 @@ class Command(BaseCommand):
def add_arguments(self, parser): def add_arguments(self, parser):
parser.add_argument('--forever', action='store_true', help='repeat the housekeeping forever (until Ctrl+C is pressed)') parser.add_argument('--forever', action='store_true', help='repeat the housekeeping forever (until Ctrl+C is pressed)')
parser.add_argument('--forever-delay', type=int, default=300, help='seconds to wait between housekeeping runs') parser.add_argument('--forever-delay', type=int, default=300, help='seconds to wait between housekeeping runs')
parser.add_argument('--skip-schedule-imports', action='store_true', help='don\'t do schedule imports')
def _do_housekeeping(self): parser.add_argument('--skip-wiki-imports', action='store_true', help='don\'t import wiki namespaces from upstream')
self._housekeeping_directmessages()
self._housekeeping_vouchers()
self._housekeeping_scheduleimports()
self._housekeeping_exportcache()
self._housekeeping_wikimports()
def _housekeeping_directmessages(self): def _housekeeping_directmessages(self):
# clear all direct messages which are after their expiry date # clear all direct messages which are after their expiry date
...@@ -120,7 +115,14 @@ class Command(BaseCommand): ...@@ -120,7 +115,14 @@ class Command(BaseCommand):
if forever: if forever:
print(timezone.now().isoformat()) print(timezone.now().isoformat())
self._do_housekeeping() # call the individual housekeeping methods
self._housekeeping_directmessages()
self._housekeeping_vouchers()
if not options.get('skip_schedule_imports'):
self._housekeeping_scheduleimports()
self._housekeeping_exportcache()
if not options.get('skip_wiki_imports'):
self._housekeeping_wikimports()
if forever: if forever:
print() # empty line print() # empty line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment