1. Mongo dial add 5 seconds connection timeout.
 2. Redis uses connection pool mode.
 3. Redis pool new connection have 10 seconds write timeout and read timeout and connection timeout.
This commit is contained in:
yaziming
2019-09-01 17:18:08 +08:00
parent d97134b288
commit 443d697c6f
9 changed files with 166 additions and 160 deletions

View File

@@ -466,7 +466,7 @@ func CancelTask(id string) (err error) {
}
// 发布消息
if err := database.Publish("nodes:"+task.NodeId.Hex(), string(msgBytes)); err != nil {
if _, err := database.RedisClient.Publish("nodes:"+task.NodeId.Hex(), string(msgBytes)); err != nil {
return err
}
}