mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-20 16:01:36 +02:00
refactor: update pool initialization to include pool key
This commit is contained in:
2
goutils
2
goutils
Submodule goutils updated: 480773ef00...be5938f43c
@@ -66,8 +66,8 @@ func NewEntrypoint(parent task.Parent, cfg *Config) *Entrypoint {
|
|||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
findRouteFunc: findRouteAnyDomain,
|
findRouteFunc: findRouteAnyDomain,
|
||||||
shortLinkMatcher: newShortLinkMatcher(),
|
shortLinkMatcher: newShortLinkMatcher(),
|
||||||
streamRoutes: pool.New[types.StreamRoute]("stream_routes"),
|
streamRoutes: pool.New[types.StreamRoute]("stream_routes", "stream_routes"),
|
||||||
excludedRoutes: pool.New[types.Route]("excluded_routes"),
|
excludedRoutes: pool.New[types.Route]("excluded_routes", "excluded_routes"),
|
||||||
servers: xsync.NewMap[string, *httpServer](),
|
servers: xsync.NewMap[string, *httpServer](),
|
||||||
}
|
}
|
||||||
return ep
|
return ep
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ func (srv *httpServer) Listen(addr string, proto HTTPProto) error {
|
|||||||
}
|
}
|
||||||
srv.stopFunc = task.FinishAndWait
|
srv.stopFunc = task.FinishAndWait
|
||||||
srv.addr = addr
|
srv.addr = addr
|
||||||
srv.routes = pool.New[types.HTTPRoute](fmt.Sprintf("[%s] %s", proto, addr))
|
srv.routes = pool.New[types.HTTPRoute](fmt.Sprintf("[%s] %s", proto, addr), "http_routes")
|
||||||
srv.routes.DisableLog(srv.ep.httpPoolDisableLog.Load())
|
srv.routes.DisableLog(srv.ep.httpPoolDisableLog.Load())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const maxWeight int = 100
|
|||||||
func New(cfg *types.LoadBalancerConfig) *LoadBalancer {
|
func New(cfg *types.LoadBalancerConfig) *LoadBalancer {
|
||||||
lb := &LoadBalancer{
|
lb := &LoadBalancer{
|
||||||
LoadBalancerConfig: cfg,
|
LoadBalancerConfig: cfg,
|
||||||
pool: pool.New[types.LoadBalancerServer]("loadbalancer." + cfg.Link),
|
pool: pool.New[types.LoadBalancerServer]("loadbalancer."+cfg.Link, "loadbalancers"),
|
||||||
l: log.With().Str("name", cfg.Link).Logger(),
|
l: log.With().Str("name", cfg.Link).Logger(),
|
||||||
}
|
}
|
||||||
lb.UpdateConfigIfNeeded(cfg)
|
lb.UpdateConfigIfNeeded(cfg)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func (n *NodeConfig) Validate() error {
|
|||||||
return errs.Error()
|
return errs.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
var Nodes = pool.New[*Node]("proxmox_nodes")
|
var Nodes = pool.New[*Node]("proxmox_nodes", "proxmox_node")
|
||||||
|
|
||||||
func NewNode(client *Client, name, id string) *Node {
|
func NewNode(client *Client, name, id string) *Node {
|
||||||
return &Node{
|
return &Node{
|
||||||
|
|||||||
Reference in New Issue
Block a user