diff --git a/dags/business/business/community/comm.py b/dags/business/business/community/comm.py index 9fb3d99..c98b037 100644 --- a/dags/business/business/community/comm.py +++ b/dags/business/business/community/comm.py @@ -1,10 +1,10 @@ """ 同步小区基本信息至ES206 """ -import sys -sys.path.insert(0, '/opt/airflow/dags/repo') -import dags.install as install -install.install() +# import sys +# sys.path.insert(0, '/opt/airflow/dags/repo') +# import dags.install as install +# install.install() import logging import pandas as pd @@ -132,6 +132,11 @@ def sync(city=None): count += len(actions) log.info("更新:" + str(count)) actions.clear() + if len(actions) > 0: + helpers.bulk(es206_client.elastic_client, actions) + count += len(actions) + log.info("更新:" + str(count)) + actions.clear() # 对于不存在的插入 count = 0 @@ -153,6 +158,8 @@ def sync(city=None): actions.clear() if len(actions) > 0: helpers.bulk(es206_client.elastic_client, actions) + count += len(actions) + log.info("插入:" + str(count)) actions.clear() # 写入csv文件,防止小区变动导致的后续过程更新报错