feat: add max age to replications create and update (#367)
This commit is contained in:
@ -25,6 +25,7 @@ type CreateParams struct {
|
||||
MaxQueueSize int64
|
||||
DropNonRetryableData bool
|
||||
NoDropNonRetryableData bool
|
||||
MaxAge int64
|
||||
}
|
||||
|
||||
func (c Client) Create(ctx context.Context, params *CreateParams) error {
|
||||
@ -41,6 +42,7 @@ func (c Client) Create(ctx context.Context, params *CreateParams) error {
|
||||
LocalBucketID: params.LocalBucketID,
|
||||
RemoteBucketID: params.RemoteBucketID,
|
||||
MaxQueueSizeBytes: params.MaxQueueSize,
|
||||
MaxAgeSeconds: params.MaxAge,
|
||||
}
|
||||
|
||||
// set optional params if specified
|
||||
@ -118,6 +120,7 @@ type UpdateParams struct {
|
||||
MaxQueueSize int64
|
||||
DropNonRetryableData bool
|
||||
NoDropNonRetryableData bool
|
||||
MaxAge int64
|
||||
}
|
||||
|
||||
func (c Client) Update(ctx context.Context, params *UpdateParams) error {
|
||||
@ -153,6 +156,10 @@ func (c Client) Update(ctx context.Context, params *UpdateParams) error {
|
||||
body.SetDropNonRetryableData(*dropNonRetryableDataBoolPtr)
|
||||
}
|
||||
|
||||
if params.MaxAge != 0 {
|
||||
body.SetMaxAgeSeconds(params.MaxAge)
|
||||
}
|
||||
|
||||
// send patch request
|
||||
res, err := c.PatchReplicationByID(ctx, params.ReplicationID).ReplicationUpdateRequest(body).Execute()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user