diff options
| author | chrislu <chris.lu@gmail.com> | 2025-07-18 00:48:55 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-07-18 00:48:56 -0700 |
| commit | 121f6ef2c00de51099314e8ec5967aabdaee7859 (patch) | |
| tree | 7c1cc1b43dbd8b2c232f18f20a2ba9025686c3dd | |
| parent | 22673fee76c02ee6ce5b5a760d98bcb89d7b432f (diff) | |
| download | seaweedfs-121f6ef2c00de51099314e8ec5967aabdaee7859.tar.xz seaweedfs-121f6ef2c00de51099314e8ec5967aabdaee7859.zip | |
avoid duplidated work
| -rw-r--r-- | weed/s3api/s3api_object_handlers_put.go | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go index 6c73f1d06..f5a626d73 100644 --- a/weed/s3api/s3api_object_handlers_put.go +++ b/weed/s3api/s3api_object_handlers_put.go @@ -433,21 +433,10 @@ func (s3a *S3ApiServer) applyBucketDefaultRetention(bucket string, entry *filer_ return nil } - // Try to get bucket configuration from cache first, then from filer - var bucketConfig *BucketConfig - var errCode s3err.ErrorCode - - // Check cache first for performance - var found bool - bucketConfig, found = s3a.bucketConfigCache.Get(bucket) - if found { - errCode = s3err.ErrNone - } else { - // Fall back to filer if not in cache - bucketConfig, errCode = s3a.getBucketConfig(bucket) - if errCode != s3err.ErrNone { - return fmt.Errorf("failed to get bucket config: %v", errCode) - } + // Get bucket configuration (getBucketConfig handles caching internally) + bucketConfig, errCode := s3a.getBucketConfig(bucket) + if errCode != s3err.ErrNone { + return fmt.Errorf("failed to get bucket config: %v", errCode) } // Check if bucket has cached Object Lock configuration |
