fix off by one task notification error

This commit is contained in:
simon 2023-04-08 14:28:03 +07:00
parent fb77ab44ee
commit ff89432d86
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ class IndexPaginate:
def _notify(self, processed):
"""send notification on task"""
total = self.kwargs.get("total")
progress = (processed + 1) / total
progress = processed / total
index_clean = self.index_name.lstrip("ta_").title()
message = [f"Processing {index_clean}s {processed}/{total}"]
self.kwargs.get("task").send_progress(message, progress=progress)