Skip to content

Commit

Permalink
update samples
Browse files Browse the repository at this point in the history
Signed-off-by: Eliott Bouhana <[email protected]>
  • Loading branch information
eliottness committed Oct 23, 2024
1 parent 66f4f0a commit ba08808
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 14 deletions.
65 changes: 52 additions & 13 deletions internal/injector/builtin/testdata/client/redis.go.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion samples/client/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package main
import (
"context"
"fmt"
"time"

redisv0 "github.com/go-redis/redis"
redisv7 "github.com/go-redis/redis/v7"
Expand Down Expand Up @@ -65,7 +66,11 @@ func redigoClient(ctx context.Context, net, addr string) {
use(conn)
}

if conn, err := redigo.DialURL(fmt.Sprintf("%s://%s", net, addr)); err != nil {
options := []redigo.DialOption{
redigo.DialConnectTimeout(5 * time.Second),
}

if conn, err := redigo.DialURL(fmt.Sprintf("%s://%s", net, addr), options...); err != nil {
panic(err)
} else {
use(conn)
Expand Down

0 comments on commit ba08808

Please sign in to comment.