Commit 0e5287e9 authored by lixiaofang's avatar lixiaofang

add

parent be937165
......@@ -18,7 +18,6 @@ from libs.cache import redis_client
@shared_task
def write_to_es(es_type, pk_list, use_batch_query_set=False):
logging.info("get -----------------")
logging.info("consume es_type:%s" % str(es_type))
try:
......@@ -33,19 +32,17 @@ def write_to_es(es_type, pk_list, use_batch_query_set=False):
use_batch_query_set=use_batch_query_set,
es=ESPerform.get_cli()
)
else:
if es_type == "suggest_v1" or es_type == "suggest":
pk_list = list(frozenset(pk_list))
type_info_map = get_type_info_associate()
type_info = type_info_map[es_type]
pk_list = list(frozenset(pk_list))
type_info_map = get_type_info_associate()
type_info = type_info_map[es_type]
type_info.insert_table_by_pk_list(
sub_index_name=type_info.name,
pk_list=pk_list,
use_batch_query_set=use_batch_query_set,
es=ESPerform.get_cli()
)
type_info.insert_table_by_pk_list(
sub_index_name=type_info.name,
pk_list=pk_list,
use_batch_query_set=use_batch_query_set,
es=ESPerform.get_cli()
)
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment