Skip to content

Commit

Permalink
NAS-111099 / 12.0 / Fix replication progress saying "total 11.12 TiB …
Browse files Browse the repository at this point in the history
…of 11.04 TiB" (truenas#7140)
  • Loading branch information
themylogin authored Jul 12, 2021
1 parent a9fa6dc commit f1f05db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middlewared/middlewared/plugins/zettarepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,12 @@ def _set_replication_task_progress(self, job, snapshot_start_message, snapshot_p
)

if data_progress_message is not None:
# Destination can result being larger than source
# Do this to avoid displaying progress like "[total 11.11 TiB out of 11.04 TiB]"
total = max(data_progress_message.dst_size, data_progress_message.src_size)
text += (
f" [total {humanfriendly.format_size(data_progress_message.dst_size, binary=True)} of "
f"{humanfriendly.format_size(data_progress_message.src_size, binary=True)}]"
f"{humanfriendly.format_size(total, binary=True)}]"
)

job.set_progress(progress, text)
Expand Down

0 comments on commit f1f05db

Please sign in to comment.