influxdata / influxdb-client-go

InfluxDB 2 Go Client
MIT License
609 stars 116 forks source link

retention not change after call UpdateBucket #397

Closed ThinkontrolSY closed 11 months ago

ThinkontrolSY commented 11 months ago

Specifications

Steps to reproduce

update bucket to change it's retention, but not work

        bucketApi := client.BucketsAPI()

    if bucketInst, err := bucketApi.FindBucketByName(ctx, bucketName); err == nil && bucketInst != nil {
        bucketInst.RetentionRules = domain.RetentionRules([]domain.RetentionRule{
            {
                EverySeconds: retention * 3600 * 24,
            },
        })
        _, err = bucketApi.UpdateBucket(ctx, bucketInst)
        if err != nil {
            log.Error(err)
            return err
        }
    } else {
        log.Error(err)
        return err
    }

Expected behavior

bucket with bucketName should update it's retention, but it's not

Actual behavior

bucket with bucketName should update it's retention, but it's not

Additional info

No response

ThinkontrolSY commented 11 months ago

Sorry, It seams the fault in my code