From c17e2e6dd19331a20a36537e76640762c630c21e Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 20 Sep 2021 19:10:39 +0700 Subject: [PATCH] skip post_bulk_restore if empty --- tubearchivist/home/src/index_management.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubearchivist/home/src/index_management.py b/tubearchivist/home/src/index_management.py index ffff651..4189246 100644 --- a/tubearchivist/home/src/index_management.py +++ b/tubearchivist/home/src/index_management.py @@ -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: