From 8681268f151a149137bbe865f3a3c78df67d3142 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Wed, 23 Nov 2022 11:40:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=86=B2=E7=AA=81=E9=87=8D?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/community/total_price_complete.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/dags/business/business/community/total_price_complete.py b/dags/business/business/community/total_price_complete.py index 43bc002..84ea5fc 100644 --- a/dags/business/business/community/total_price_complete.py +++ b/dags/business/business/community/total_price_complete.py @@ -41,23 +41,18 @@ def sync(): "_op_type": "update", "_index": index_name, "_id": item['_id'], - "doc": doc_info + "doc": doc_info, + "_retry_on_conflict": 5 } actions.append(action) if len(actions) == 5000: - try: - helpers.bulk(es206_client.elastic_client, actions) - count += len(actions) - logging.info("已补全:" + str(count)) - except Exception as e: - log.error(e) + helpers.bulk(es206_client.elastic_client, actions) + count += len(actions) + logging.info("已补全:" + str(count)) actions.clear() if len(actions) > 0: - try: - helpers.bulk(es206_client.elastic_client, actions) - except Exception as e: - log.error(e) + helpers.bulk(es206_client.elastic_client, actions) actions.clear() log.info(f"完成补全户均总价信息至206 {index_name}")