-
Notifications
You must be signed in to change notification settings - Fork 75
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
建议将Duration放到可配置项中 #8
Comments
这里的Duration和节点心跳/节点信息有效期有直接关系,如果设置时间过长,当部分节点宕机时其他节点没有及时刷新节点列表可能会导致任务丢失。 |
func (rd *RedisDriver) heartBear(nodeID string) {
} 建议这段代码进行延长有效期的时候,如果返回值为0 时,重新注册一下,不然如果设置值超过一秒,就容易导致节点不执行任务 |
这个时间建议可以设置,但是可以注明后果是什么,因为5-10秒应该有些人还是能接收的 |
感谢建议,已经添加可选项 |
|
建议将Duration放到可配置项中,不然
func (np *NodePool) tickerUpdatePool() { tickers := time.NewTicker(time.Second * defaultDuration) for range tickers.C { if np.dcron.isRun { np.updatePool() } } }
直接for循环扫描redis,对性能有影响.
The text was updated successfully, but these errors were encountered: