mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
Architectural shift to using context for config and module state
This commit is contained in:
parent
ff5b4639d5
commit
1f0c061ce3
11 changed files with 313 additions and 359 deletions
|
@ -76,7 +76,7 @@ var (
|
|||
)
|
||||
|
||||
// NewLoadBalancedReverseProxy returns a collection of Upstreams that are to be loadbalanced.
|
||||
func NewLoadBalancedReverseProxy(lb *LoadBalanced, state *State) error {
|
||||
func NewLoadBalancedReverseProxy(lb *LoadBalanced, state *State, ctx caddy2.Context) error {
|
||||
// set defaults
|
||||
if lb.NoHealthyUpstreamsMessage == "" {
|
||||
lb.NoHealthyUpstreamsMessage = msgNoHealthyUpstreams
|
||||
|
@ -115,7 +115,7 @@ func NewLoadBalancedReverseProxy(lb *LoadBalanced, state *State) error {
|
|||
|
||||
if uc.CircuitBreaker != nil {
|
||||
if _, err := caddy2.GetModule(cbModule); err == nil {
|
||||
val, err := caddy2.LoadModule(cbModule, uc.CircuitBreaker)
|
||||
val, err := ctx.LoadModule(cbModule, uc.CircuitBreaker)
|
||||
if err == nil {
|
||||
cbv, ok := val.(CircuitBreaker)
|
||||
if ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue