mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
Merge pull request #7924 from ioito/automated-cherry-pick-of-#7921-upstream-release-3.2
Automated cherry pick of #7921: fix: bucket object cnt fix
This commit is contained in:
@@ -199,7 +199,13 @@ func (manager *SBucketManager) newFromCloudBucket(
|
||||
|
||||
stats := extBucket.GetStats()
|
||||
bucket.SizeBytes = stats.SizeBytes
|
||||
if bucket.SizeBytes < 0 {
|
||||
bucket.SizeBytes = 0
|
||||
}
|
||||
bucket.ObjectCnt = stats.ObjectCount
|
||||
if bucket.ObjectCnt < 0 {
|
||||
bucket.ObjectCnt = 0
|
||||
}
|
||||
|
||||
limit := extBucket.GetLimit()
|
||||
limitSupport := extBucket.LimitSupport()
|
||||
@@ -259,7 +265,13 @@ func (bucket *SBucket) syncWithCloudBucket(
|
||||
diff, err := db.UpdateWithLock(ctx, bucket, func() error {
|
||||
stats := extBucket.GetStats()
|
||||
bucket.SizeBytes = stats.SizeBytes
|
||||
if bucket.SizeBytes < 0 {
|
||||
bucket.SizeBytes = 0
|
||||
}
|
||||
bucket.ObjectCnt = stats.ObjectCount
|
||||
if bucket.ObjectCnt < 0 {
|
||||
bucket.ObjectCnt = 0
|
||||
}
|
||||
|
||||
if !statsOnly {
|
||||
limit := extBucket.GetLimit()
|
||||
|
||||
Reference in New Issue
Block a user