mirror of
https://github.com/openziti/zrok.git
synced 2025-08-16 19:01:16 +02:00
allocate an edge management session when it's needed, rather than trying to be efficient and keep one around
This commit is contained in:
@ -34,25 +34,20 @@ type Agent struct {
|
||||
}
|
||||
|
||||
func NewAgent(cfg *Config, ifxCfg *metrics.InfluxConfig, zCfg *zrokEdgeSdk.Config, emailCfg *emailUi.Config, str *store.Store) (*Agent, error) {
|
||||
edge, err := zrokEdgeSdk.Client(zCfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
a := &Agent{
|
||||
cfg: cfg,
|
||||
ifx: newInfluxReader(ifxCfg),
|
||||
zCfg: zCfg,
|
||||
str: str,
|
||||
queue: make(chan *metrics.Usage, 1024),
|
||||
acctWarningActions: []AccountAction{newAccountWarningAction(emailCfg, str, edge)},
|
||||
acctLimitActions: []AccountAction{newAccountLimitAction(str, edge)},
|
||||
acctRelaxActions: []AccountAction{newAccountRelaxAction(str, edge)},
|
||||
envWarningActions: []EnvironmentAction{newEnvironmentWarningAction(emailCfg, str, edge)},
|
||||
envLimitActions: []EnvironmentAction{newEnvironmentLimitAction(str, edge)},
|
||||
envRelaxActions: []EnvironmentAction{newEnvironmentRelaxAction(str, edge)},
|
||||
shrWarningActions: []ShareAction{newShareWarningAction(emailCfg, str, edge)},
|
||||
shrLimitActions: []ShareAction{newShareLimitAction(str, edge)},
|
||||
shrRelaxActions: []ShareAction{newShareRelaxAction(str, edge)},
|
||||
acctWarningActions: []AccountAction{newAccountWarningAction(emailCfg, str)},
|
||||
acctRelaxActions: []AccountAction{newAccountRelaxAction(str, zCfg)},
|
||||
envWarningActions: []EnvironmentAction{newEnvironmentWarningAction(emailCfg, str)},
|
||||
envLimitActions: []EnvironmentAction{newEnvironmentLimitAction(str, zCfg)},
|
||||
envRelaxActions: []EnvironmentAction{newEnvironmentRelaxAction(str, zCfg)},
|
||||
shrWarningActions: []ShareAction{newShareWarningAction(emailCfg, str)},
|
||||
shrLimitActions: []ShareAction{newShareLimitAction(str, zCfg)},
|
||||
shrRelaxActions: []ShareAction{newShareRelaxAction(str, zCfg)},
|
||||
close: make(chan struct{}),
|
||||
join: make(chan struct{}),
|
||||
}
|
||||
|
Reference in New Issue
Block a user