-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial sentinel dial has no timeout #68
Comments
Hi @fillest ! thanks for submitting the issue. The I've had a lot of issues submitted lately about the sentinel package though, it wasn't designed particularly well when I first did so, and I'm thinking I'll add a |
Hi. func DoWithTimeout(cb func(), t time.Duration, panicValue interface{}) {
done := make(chan bool, 1)
go func() {
defer someInternalPanicReporter()
cb()
done <- true
}()
select {
case <-done:
case <-time.After(t):
panic(panicValue)
}
}
...
var err error
helpers.DoWithTimeout(func() {
client, err = sentinel.NewClientCustom("tcp", addr, POOL_SIZE, dial, "smth")
}, 3*time.Second, "Redis Sentinel communication timeout")
if err != nil {
panic(err)
} |
sentinel.NewClientCustom
uses hardcodedredis.Dial
at the beginning. Shouldn't it use the same passeddf DialFunc
instead? So one could pass a DialTimeout wrapper.The text was updated successfully, but these errors were encountered: