Use only valkey go - #202
Draft
majst01 wants to merge 12 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
=======================================
Coverage 72.45% 72.46%
=======================================
Files 194 194
Lines 15243 15249 +6
=======================================
+ Hits 11045 11050 +5
Misses 3102 3102
- Partials 1096 1097 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
majst01
commented
May 15, 2026
| expectCertStore(t, ctx, certStore, 1) | ||
| expectTokenWorks(t, ctx, auth, token1) | ||
| }, | ||
| // synctest.Test(t, func(t *testing.T) { |
Contributor
Author
There was a problem hiding this comment.
valkey-go has its own background worker which breaks synctest.Test
majst01
commented
May 15, 2026
|
|
||
| return err | ||
| cmds := make(valkey.Commands, 0, 2) | ||
| cmds = append(cmds, c.B().Set().Key(keyFn()).Value(string(encoded)).Exat(i.GetExpiresAt().AsTime()).Build()) |
Contributor
Author
There was a problem hiding this comment.
clarify the usage of .Ex() vs .Exat()
majst01
commented
May 15, 2026
…into use-only-valkey-go
majst01
marked this pull request as ready for review
June 8, 2026 08:59
Gerrit91
reviewed
Jun 8, 2026
| cmds = append(cmds, r.client.B().Set().Key(keyPublic()).Value(string(rawBytes)).Ex(expires).Build()) | ||
| for i, resp := range r.client.DoMulti(ctx, cmds...) { | ||
| if resp.Error() != nil { | ||
| return nil, fmt.Errorf("unable to store certificate with command:%s %w", cmds[i].Commands()[1], resp.Error()) |
Comment on lines
+134
to
+136
| cmds := make(valkey.Commands, 0, 2) | ||
| cmds = append(cmds, r.client.B().Set().Key(keyPrivateLatest()).Value(string(encoded)).Ex(expires).Build()) | ||
| cmds = append(cmds, r.client.B().Set().Key(keyPublic()).Value(string(rawBytes)).Ex(expires).Build()) |
| err = json.Unmarshal(encoded, &e) | ||
| if err != nil { | ||
| return zero, err | ||
| return zero, fmt.Errorf("unable to unmarshal secret from bytes:%w", err) |
Contributor
There was a problem hiding this comment.
Suggested change
| return zero, fmt.Errorf("unable to unmarshal secret from bytes:%w", err) | |
| return zero, fmt.Errorf("unable to unmarshal invite from bytes: %w", err) |
| cmds = append(cmds, c.B().Set().Key(keyFn()).Value(string(encoded)).Exat(i.GetExpiresAt().AsTime()).Build()) | ||
| cmds = append(cmds, c.B().Set().Key(secretkey(i.GetSecret())).Value(string(encoded)).Exat(i.GetExpiresAt().AsTime()).Build()) | ||
| for _, cmd := range cmds { | ||
| fmt.Printf("cmd:%s\n", cmd.Commands()) |
majst01
marked this pull request as draft
June 8, 2026 11:12
vknabel
reviewed
Jun 8, 2026
Comment on lines
-21
to
+20
| t.Parallel() | ||
| // t.Parallel() |
…into use-only-valkey-go
Contributor
Author
|
Not to be merged immediately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This migrates all our valkey client code to valkey-go except the one for asynq (interface does not allow it).
During the refactoring i think i found some BUGs with the expiration of tokens, even if expiration was set to time.Now() the tokens where still present during the tests. I had to explicitly set the expiration to an hour in the future to make most of the tests work again ?
Benchmarks also show some nice improvements:
Hibeken Asynq does not support valkey-go, did not try to convert to use valkeycompat either.
Used AI-Tools ✨