| 531 | } |
| 532 | |
| 533 | func (vrc *ValkeyRingClient) SetWithExpire(ctx context.Context, key string, value string, expire time.Duration) error { |
| 534 | results := vrc.ring.SetWithExpire(ctx, key, value, expire) |
| 535 | for _, res := range results { |
| 536 | if err := res.Error(); err != nil { |
| 537 | return err |
| 538 | } |
| 539 | } |
| 540 | if len(results) == 0 { |
| 541 | return fmt.Errorf("failed to SetWithExpire, no result") |
| 542 | } |
| 543 | return results[len(results)-1].Error() |
| 544 | } |
| 545 | |
| 546 | func (vrc *ValkeyRingClient) ZAdd(ctx context.Context, key, val string, score float64) (int64, error) { |
| 547 | res := vrc.ring.ZAdd(ctx, key, val, score) |