Add component 'Template' (#3562)

### What problem does this PR solve?

#3560

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-11-21 18:26:22 +08:00
committed by GitHub
parent 193b08a3ed
commit ee50f78d99
6 changed files with 9 additions and 8 deletions

View File

@ -238,7 +238,7 @@ class ESConnection(DocStoreConnection):
for _ in range(ATTEMPT_TIME):
try:
r = self.es.bulk(index=(indexName), operations=operations,
refresh=False, timeout="600s")
refresh=False, timeout="60s")
if re.search(r"False", str(r["errors"]), re.IGNORECASE):
return res
@ -249,7 +249,9 @@ class ESConnection(DocStoreConnection):
return res
except Exception as e:
logging.warning("ESConnection.insert got exception: " + str(e))
res = []
if re.search(r"(Timeout|time out)", str(e), re.IGNORECASE):
res.append(str(e))
time.sleep(3)
continue
return res