File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,11 +331,22 @@ func (status globalMirrorGroupStatus) GetRemoteSiteStatus(ctx context.Context) (
331331 totalSnapshotDuration += * localSnapInfo .LastSnapshotDuration
332332 }
333333 err = nil
334- totalDuration := int64 (totalSnapshotDuration / int64 (totalImages ))
334+ totalDuration := int64 (0 )
335+ if totalSnapshotDuration > 0 {
336+ totalDuration = int64 (totalSnapshotDuration / int64 (totalImages ))
337+ }
338+ totalTime := int64 (0 )
339+ if totalSnpshotTime > 0 {
340+ totalTime = int64 (totalSnpshotTime / int64 (totalImages ))
341+ }
342+ totalBytes := int64 (0 )
343+ if totalSnapshotBytes > 0 {
344+ totalBytes = int64 (totalSnapshotBytes / int64 (totalImages ))
345+ }
335346 // write the total snapshot time, bytes and duration to the description
336347 d := localStatus {
337- LocalSnapshotTime : int64 ( totalSnpshotTime / int64 ( totalImages )) ,
338- LastSnapshotBytes : int64 ( totalSnapshotBytes / int64 ( totalImages )) ,
348+ LocalSnapshotTime : totalTime ,
349+ LastSnapshotBytes : totalBytes ,
339350 LastSnapshotDuration : & totalDuration ,
340351 }
341352 description , err := json .Marshal (d )
You can’t perform that action at this time.
0 commit comments