Skip to content

Commit

Permalink
fix i/o durations
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Aug 20, 2024
1 parent aa1c06b commit 0c539e8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"strconv"
"strings"
"time"

"github.com/redis/go-redis/v9"
)
Expand All @@ -23,20 +24,18 @@ func InitializeDb(addr string, password string, db int) (*Instance, error) {
redisOptions = &redis.Options{
Addr: addr,
DB: db,
MaxRetries: 30,
DialTimeout: 30,
ReadTimeout: 30,
WriteTimeout: 30,
DialTimeout: 1 * time.Minute,
ReadTimeout: 1 * time.Minute,
WriteTimeout: 1 * time.Minute,
}
} else {
redisOptions = &redis.Options{
Addr: addr,
Password: password,
DB: db,
MaxRetries: 30,
DialTimeout: 30,
ReadTimeout: 30,
WriteTimeout: 30,
DialTimeout: 1 * time.Minute,
ReadTimeout: 1 * time.Minute,
WriteTimeout: 1 * time.Minute,
}
}

Expand Down

0 comments on commit 0c539e8

Please sign in to comment.