Redis has some sort of timeout after 1hr, which raises EOF error when I'm subscribing to some channels.
My Code:
pubsub := redis.PubSubConn{Conn: rc}
events := ["controller"]
err = pubsub.Subscribe(events)
if err != nil {
return
}
for {
switch v := pubsub.Receive().(type) {
case error:
log.Printf("Error: %v", v)
return
case redis.Message:
...
And each hour I see this in the logs (which cause my service to crash):
Error: EOF
Why do I always receive this EOF message? Should I set some kind of a timeout somewhere?
Versions:
Redis docker => redis:6.0.9-alpine (no redis.conf)
redigo => v1.8.3