mirror of
https://github.com/silenceper/wechat.git
synced 2026-11-16 05:12:03 +08:00
cache增加带Context版本,开放平台相关接口支持Context版本 (#653)
This commit is contained in:
1 parent
01784c2a4a
commit
07b7dc40fc
7 files changed
+178
-43
No files matched your search
Vendored
+8
-2
@@ -4,17 +4,23 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
)
|
||||
|
||||
func TestRedis(t *testing.T) {
|
||||
server, err := miniredis.Run()
|
||||
if err != nil {
|
||||
t.Error("miniredis.Run Error", err)
|
||||
}
|
||||
t.Cleanup(server.Close)
|
||||
var (
|
||||
timeoutDuration = time.Second
|
||||
ctx = context.Background()
|
||||
opts = &RedisOpts{
|
||||
Host: "127.0.0.1:6379",
|
||||
Host: server.Addr(),
|
||||
}
|
||||
redis = NewRedis(ctx, opts)
|
||||
err error
|
||||
val = "silenceper"
|
||||
key = "username"
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user