Skip to content
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

不读取返回的消息是否不妥 #11

Open
sirodeneko opened this issue Jun 10, 2021 · 0 comments
Open

不读取返回的消息是否不妥 #11

sirodeneko opened this issue Jun 10, 2021 · 0 comments

Comments

@sirodeneko
Copy link

sirodeneko commented Jun 10, 2021

if _, err := cli.KeepAlive(context.TODO(), resp.ID); err != nil {

官方文档

// KeepAlive keeps the given lease alive forever. If the keepalive response
// posted to the channel is not consumed immediately, the lease client will
// continue sending keep alive requests to the etcd server at least every
// second until latest response is consumed.
KeepAlive使给定的租约永远活着。
如果发布到通道上的keepalive响应没有立即被消耗,
租赁客户端将继续向etcd服务器发送keep alive请求,
至少每秒钟一次,直到最新的响应被消耗掉。

如果不进行读取,将会以每秒一次的频率进行需约。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant