예제 #1
0
 def test_rebuild_chunk(self, apply_async):
     cache.set(settings.WIKI_REBUILD_TOKEN, True)
     rebuild_kb()
     assert not cache.get(settings.WIKI_REBUILD_TOKEN)
     assert 'args' in apply_async.call_args[1]
     # There should be 4 documents with an approved revision
     eq_(4, len(apply_async.call_args[1]['args'][0]))
예제 #2
0
 def test_rebuild_chunk(self, apply_async):
     cache.set(settings.WIKI_REBUILD_TOKEN, True)
     rebuild_kb()
     assert not cache.get(settings.WIKI_REBUILD_TOKEN)
     assert 'args' in apply_async.call_args[1]
     # There should be 4 documents with an approved revision
     eq_(4, len(apply_async.call_args[1]['args'][0]))
예제 #3
0
    def handle(self, **options):
        # If rebuild on demand switch is on, do nothing.
        if waffle.switch_is_active('wiki-rebuild-on-demand'):
            return

        tasks.rebuild_kb()
예제 #4
0
파일: cron.py 프로젝트: AndryulE/kitsune
def rebuild_kb():
    # If rebuild on demand switch is on, do nothing.
    if waffle.switch_is_active('wiki-rebuild-on-demand'):
        return

    tasks.rebuild_kb()