Commit dda3c2a7 by dong

fix202302015

parent 73693353
......@@ -239,7 +239,8 @@ def search():
try:
es = Elasticsearch([{'host': '39.100.39.50', 'port': 9200}])
data = es.search(index="jincheng_pictext_index_202301131004_a6181e52", body=body)
# data = es.search(index="jincheng_pictext_index_202301131004_a6181e52", body=body)
data = es.search(index="jincheng_pictext_index_202302151628_bedd5ee8", body=body)
data_list = []
# print(data_list)
size = data["hits"]['total']
......
......@@ -90,20 +90,14 @@ def get_cluster():
def industry_cluster():
req_dic = request.get_json()
industry_name = req_dic['industry_name']
# industry_id = req_dic['industry_id']
flag = req_dic['flag']
# # 查询redis
# try:
# result = redis_store.get('industry_id_{}'.format(industry_id)).decode()
# except Exception as e:
# current_app.logger.error(e)
# return jsonify(code=RET.DBERR, msg="redis数据库异常")
try:
industry_obj = IndustryChain.query.filter_by(industry_name=industry_name).first()
industry_id = industry_obj.id
chain_id = industry_obj.chain_id
if flag == 2:
# 查询redis
result = redis_store.get('chain_id_{}'.format(industry_id))
if result:
......@@ -117,7 +111,7 @@ def industry_cluster():
except Exception as e:
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="数据异常")
if flag == 2:
try:
redis_store.setex("chain_id_%s" % industry_id, constants.INDUSTRY_ENTERPRISE_REDIS_EXPIRES, json.dumps(result))
# 保存发送给这个手机号的记录,防止用户在60s内再次出发发送短信的操作
......
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