From fe42afb620622a6d16b7efe43a9e6fe7a4f4dca9 Mon Sep 17 00:00:00 2001 From: wayblink Date: Fri, 9 Aug 2024 17:13:49 +0800 Subject: [PATCH] Fix progress may out of data range Signed-off-by: wayblink --- core/backup_meta_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/backup_meta_manager.go b/core/backup_meta_manager.go index 3d7e9c15..f9611af4 100644 --- a/core/backup_meta_manager.go +++ b/core/backup_meta_manager.go @@ -488,7 +488,7 @@ func (meta *MetaManager) GetFullMeta(id string) *backuppb.BackupInfo { } cloneBackup.CollectionBackups = collectionBackups if totalSize != 0 { - cloneBackup.Progress = int32(backupedSize * 100 / (totalSize)) + cloneBackup.Progress = int32(float64(backupedSize) / float64(totalSize) * 100) } else { cloneBackup.Progress = 100 }