def _synchronise_index(self, sql_table_cls, es_doc_cls, id_logger):
es_doc = es_doc_cls()
self._logging(logging.INFO,
'Synchronizing %s index.' % es_doc.index)
with acquire_inter_process_lock('sync_%s' % es_doc.index) as acquired:
if not acquired:
es_doc = es_doc_cls()
err_msg = 'Another process is already synchronizing the %s ' \
'index, aborting now.' % es_doc.index
self._logging(logging.WARNING, err_msg)
else:
self._perform_index_sync(sql_table_cls, es_doc_cls, id_logger)
self._logging(logging.INFO,
'Index %s is now synchronized.' % es_doc.index)
评论列表
文章目录