fix ignoring progress message when not initiated with task
This commit is contained in:
parent
b95a659396
commit
170839362e
|
@ -32,7 +32,8 @@ class ElasticBackup:
|
||||||
if not self.reason:
|
if not self.reason:
|
||||||
raise ValueError("missing backup reason in ElasticBackup")
|
raise ValueError("missing backup reason in ElasticBackup")
|
||||||
|
|
||||||
self.task.send_progress(["Scanning your index."])
|
if self.task:
|
||||||
|
self.task.send_progress(["Scanning your index."])
|
||||||
for index in self.index_config:
|
for index in self.index_config:
|
||||||
index_name = index["index_name"]
|
index_name = index["index_name"]
|
||||||
print(f"backup: export in progress for {index_name}")
|
print(f"backup: export in progress for {index_name}")
|
||||||
|
@ -42,7 +43,8 @@ class ElasticBackup:
|
||||||
|
|
||||||
self.backup_index(index_name)
|
self.backup_index(index_name)
|
||||||
|
|
||||||
self.task.send_progress(["Compress files to zip archive."])
|
if self.task:
|
||||||
|
self.task.send_progress(["Compress files to zip archive."])
|
||||||
self.zip_it()
|
self.zip_it()
|
||||||
if self.reason == "auto":
|
if self.reason == "auto":
|
||||||
self.rotate_backup()
|
self.rotate_backup()
|
||||||
|
|
Loading…
Reference in New Issue