def handle(self, *args, **kwargs): # pylint: disable=unused-argument
"""
Recreates the index
"""
log = logging.getLogger(indexing_api_name)
console = logging.StreamHandler(self.stderr)
console.setLevel(logging.DEBUG)
log.addHandler(console)
log.level = logging.INFO
if kwargs['profile']:
import cProfile
import uuid
profile = cProfile.Profile()
profile.enable()
recreate_index()
profile.disable()
filename = 'recreate_index_{}.profile'.format(uuid.uuid4())
profile.dump_stats(filename)
self.stdout.write('Output profiling data to: {}'.format(filename))
else:
recreate_index()
评论列表
文章目录