whoops
This commit is contained in:
parent
150a37b302
commit
cf49ad2f63
|
|
@ -22,14 +22,13 @@ func (u *InputUnifi) isNill(c *Controller) bool {
|
||||||
return c.Unifi == nil
|
return c.Unifi == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// newDynamicCntrlr creates and saves a controller (with auth cookie) for repeated use.
|
// newDynamicCntrlr creates and saves a controller definition for further use.
|
||||||
// This is called when an unconfigured controller is requested.
|
// This is called when an unconfigured controller is requested.
|
||||||
func (u *InputUnifi) newDynamicCntrlr(url string) (bool, *Controller) {
|
func (u *InputUnifi) newDynamicCntrlr(url string) (bool, *Controller) {
|
||||||
u.Lock()
|
u.Lock()
|
||||||
defer u.Unlock()
|
defer u.Unlock()
|
||||||
|
|
||||||
c := u.dynamic[url]
|
if c := u.dynamic[url]; c != nil {
|
||||||
if c != nil {
|
|
||||||
// it already exists.
|
// it already exists.
|
||||||
return false, c
|
return false, c
|
||||||
}
|
}
|
||||||
|
|
@ -39,7 +38,7 @@ func (u *InputUnifi) newDynamicCntrlr(url string) (bool, *Controller) {
|
||||||
u.dynamic[url].Role = url
|
u.dynamic[url].Role = url
|
||||||
u.dynamic[url].URL = url
|
u.dynamic[url].URL = url
|
||||||
|
|
||||||
return true, c
|
return true, u.dynamic[url]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *InputUnifi) dynamicController(url string) (*poller.Metrics, error) {
|
func (u *InputUnifi) dynamicController(url string) (*poller.Metrics, error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue