Skip to content

Commit 86b261c

Browse files
committed
other opts
1 parent 7d18cca commit 86b261c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rcache.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ func New(redisURL string, logger logger) *Cache {
3838

3939
if redisURL == "" {
4040
opts.Host = os.Getenv("REDISHOST")
41-
opts.Port = os.Getenv("REDISPORT")
41+
i, err := strconv.Atoi(os.Getenv("REDISPORT") + "")
42+
if err == nil {
43+
opts.Port = i
44+
}
4245
} else {
4346
opts = &xredis.Options{}
4447
u, err := url.Parse(redisURL)

0 commit comments

Comments
 (0)