We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
大佬,Polling的作用是轮询Service,但是里面的idx却并没有自增,起不到轮询的效果吧?
The text was updated successfully, but these errors were encountered:
func (p *Polling) GetService() (*discovery.Server, error) { if p.idx >= len(p.ser)-1 { p.idx = 0 } if len(p.ser) == 0 { return nil, errors.New("404 Discovery") } return p.ser[p.idx], nil }
是不是还确立一句p.idx += 1?并且要上锁?
Sorry, something went wrong.
对是有问题的, 修改idx 不推荐加锁 推荐使用原子操作 谢谢您的回复
No branches or pull requests
大佬,Polling的作用是轮询Service,但是里面的idx却并没有自增,起不到轮询的效果吧?
The text was updated successfully, but these errors were encountered: