mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-01-30 16:49:29 +00:00
ci: extra commit to fix panic
This commit will be removed later Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
0dad176296
commit
22966e8a1c
@ -331,11 +331,22 @@ func (status globalMirrorGroupStatus) GetRemoteSiteStatus(ctx context.Context) (
|
||||
totalSnapshotDuration += *localSnapInfo.LastSnapshotDuration
|
||||
}
|
||||
err = nil
|
||||
totalDuration := int64(totalSnapshotDuration / int64(totalImages))
|
||||
totalDuration := int64(0)
|
||||
if totalSnapshotDuration > 0 {
|
||||
totalDuration = int64(totalSnapshotDuration / int64(totalImages))
|
||||
}
|
||||
totalTime := int64(0)
|
||||
if totalSnpshotTime > 0 {
|
||||
totalTime = int64(totalSnpshotTime / int64(totalImages))
|
||||
}
|
||||
totalBytes := int64(0)
|
||||
if totalSnapshotBytes > 0 {
|
||||
totalBytes = int64(totalSnapshotBytes / int64(totalImages))
|
||||
}
|
||||
// write the total snapshot time, bytes and duration to the description
|
||||
d := localStatus{
|
||||
LocalSnapshotTime: int64(totalSnpshotTime / int64(totalImages)),
|
||||
LastSnapshotBytes: int64(totalSnapshotBytes / int64(totalImages)),
|
||||
LocalSnapshotTime: totalTime,
|
||||
LastSnapshotBytes: totalBytes,
|
||||
LastSnapshotDuration: &totalDuration,
|
||||
}
|
||||
description, err := json.Marshal(d)
|
||||
|
Loading…
Reference in New Issue
Block a user