cleanup some loadbalancer code

This commit is contained in:
yusing
2025-01-19 04:32:50 +08:00
parent 589b3a7a13
commit b253dce7e1
8 changed files with 136 additions and 93 deletions

View File

@@ -31,7 +31,7 @@ func (lb *LoadBalancer) newIPHash() impl {
return impl
}
func (impl *ipHash) OnAddServer(srv *Server) {
func (impl *ipHash) OnAddServer(srv Server) {
impl.mu.Lock()
defer impl.mu.Unlock()
@@ -48,7 +48,7 @@ func (impl *ipHash) OnAddServer(srv *Server) {
impl.pool = append(impl.pool, srv)
}
func (impl *ipHash) OnRemoveServer(srv *Server) {
func (impl *ipHash) OnRemoveServer(srv Server) {
impl.mu.Lock()
defer impl.mu.Unlock()