优化报错
This commit is contained in:
@@ -74,18 +74,12 @@ def sync(city=None):
|
||||
|
||||
actions.append(action)
|
||||
if len(actions) == 5000:
|
||||
try:
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
count += len(actions)
|
||||
print("已更新:" + str(count))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
count += len(actions)
|
||||
log.info("已更新:" + str(count))
|
||||
actions.clear()
|
||||
if len(actions) > 0:
|
||||
try:
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
actions.clear()
|
||||
log.info(f"完成同步出售信息至206 {index_name}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user