minor updates.

This commit is contained in:
David Newhall II 2019-06-05 18:07:30 -07:00
parent 3316d20f00
commit f275dcc637
3 changed files with 9 additions and 6 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@
.DS_Store .DS_Store
*~ *~
/package_build /package_build
/release
/unifi-poller.macos
/unifi-poller.linux

7
Gopkg.lock generated
View File

@ -2,12 +2,12 @@
[[projects]] [[projects]]
digest = "1:dbd1c953926f2aca29aeb24f13af5875a3b31f09ed7093cb18a5409d4b9fc9f1" digest = "1:91639d25b5400abb27afc5d4e201898f157a239d508dd98bcac2858fdea6869a"
name = "github.com/golift/unifi" name = "github.com/golift/unifi"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "034a62e1cb6ef13e724cfab9b8f87dbb130d493c" revision = "a88e9234a418f7880d4da4e651899bb5a7185ec7"
version = "v2.0.0" version = "v2.0.1"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -63,6 +63,7 @@
"github.com/golift/unifi", "github.com/golift/unifi",
"github.com/influxdata/influxdb1-client/v2", "github.com/influxdata/influxdb1-client/v2",
"github.com/naoina/toml", "github.com/naoina/toml",
"github.com/pkg/errors",
"github.com/spf13/pflag", "github.com/spf13/pflag",
] ]
solver-name = "gps-cdcl" solver-name = "gps-cdcl"

View File

@ -131,7 +131,6 @@ func (c *Config) PollUnifiController(controller *unifi.Unifi, infdb influx.Clien
logErrors([]error{err}, "influx.NewBatchPoints") logErrors([]error{err}, "influx.NewBatchPoints")
continue continue
} }
// Batch all the points. // Batch all the points.
if errs := batchPoints(devices, clients, bp); errs != nil && hasErr(errs) { if errs := batchPoints(devices, clients, bp); errs != nil && hasErr(errs) {
logErrors(errs, "asset.Points()") logErrors(errs, "asset.Points()")
@ -167,7 +166,7 @@ func filterSites(controller *unifi.Unifi, filter []string) ([]unifi.Site, error)
} }
// batchPoints combines all device and client data into influxdb data points. // batchPoints combines all device and client data into influxdb data points.
func batchPoints(devices *unifi.Devices, clients *unifi.Clients, batchPoints influx.BatchPoints) (errs []error) { func batchPoints(devices *unifi.Devices, clients *unifi.Clients, bp influx.BatchPoints) (errs []error) {
process := func(asset Asset) error { process := func(asset Asset) error {
if asset == nil { if asset == nil {
return nil return nil
@ -176,7 +175,7 @@ func batchPoints(devices *unifi.Devices, clients *unifi.Clients, batchPoints inf
if err != nil { if err != nil {
return err return err
} }
batchPoints.AddPoints(influxPoints) bp.AddPoints(influxPoints)
return nil return nil
} }
if devices != nil { if devices != nil {