diff --git a/src/core/management/commands/housekeeping.py b/src/core/management/commands/housekeeping.py index 90e081ff6966469969c9eee4cf36e8d3bb80e0dc..a1645d065c62615fd60e433a04d0e1b1bab8a1eb 100644 --- a/src/core/management/commands/housekeeping.py +++ b/src/core/management/commands/housekeeping.py @@ -15,13 +15,8 @@ class Command(BaseCommand): 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-delay', type=int, default=300, help='seconds to wait between housekeeping runs') - - def _do_housekeeping(self): - self._housekeeping_directmessages() - self._housekeeping_vouchers() - self._housekeeping_scheduleimports() - self._housekeeping_exportcache() - self._housekeeping_wikimports() + parser.add_argument('--skip-schedule-imports', action='store_true', help='don\'t do schedule imports') + parser.add_argument('--skip-wiki-imports', action='store_true', help='don\'t import wiki namespaces from upstream') def _housekeeping_directmessages(self): # clear all direct messages which are after their expiry date @@ -120,7 +115,14 @@ class Command(BaseCommand): if forever: 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: print() # empty line