skip post_bulk_restore if empty

This commit is contained in:
simon 2021-09-20 19:10:39 +07:00
parent 4b9acd4c51
commit c17e2e6dd1
1 changed files with 3 additions and 0 deletions

View File

@ -481,6 +481,9 @@ class ElasticBackup:
with open(file_path, 'r', encoding='utf-8') as f:
query_str = f.read()
if not query_str.strip():
return
url = es_url + '/_bulk'
request = requests.post(url, data=query_str, headers=headers)
if not request.ok: