def schedule_rebuild_kb():
 if ((not waffle.switch_is_active('wiki-rebuild-on-demand')) or settings.CELERY_ALWAYS_EAGER):
  return
 if cache.get(settings.WIKI_REBUILD_TOKEN):
  log.debug('Rebuild task already scheduled.')
  return
 cache.set(settings.WIKI_REBUILD_TOKEN, True)
 rebuild_kb.delay()

def schedule_rebuild_kb ( ) : if ( ( not waffle . switch_is_active ( 'wiki-rebuild-on-demand' ) ) or settings . CELERY_ALWAYS_EAGER ) : return if cache . get ( settings . WIKI_REBUILD_TOKEN ) : log . debug ( 'Rebuild task already scheduled.' ) return cache . set ( settings . WIKI_REBUILD_TOKEN , True ) rebuild_kb . delay ( )
try to schedule a kb rebuild .