Exemple #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]))
 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]))
Exemple #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()
Exemple #4
0
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()