<s> from __future__ import absolute_import <EOL> import os <EOL> from celery import shared_task <EOL> from django . core import management <EOL> from leonardo . decorators import catch_result <EOL> from django . conf import settings <EOL> @ shared_task <EOL> @ catch_result <EOL> def sync_search_indexes ( ) : <EOL> management . call_command ( '<STR_LIT>' , interactive = False ) <EOL> haystack = getattr ( settings , '<STR_LIT>' , None ) <EOL> if '<STR_LIT:default>' in haystack and '<STR_LIT>' in haystack [ '<STR_LIT:default>' ] [ '<STR_LIT>' ] : <EOL> try : <EOL> os . remove ( os . path . join ( <EOL> haystack [ '<STR_LIT:default>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) ) <EOL> except : <EOL> pass <EOL> return { '<STR_LIT:result>' : '<STR_LIT>' } </s>
