mirror of
https://github.com/openziti/zrok.git
synced 2024-11-07 08:44:14 +01:00
better handling of non-zrok usage data
This commit is contained in:
parent
36d267256f
commit
23c275f930
@ -220,7 +220,7 @@ mainLoop:
|
||||
lastCycle = time.Now()
|
||||
}
|
||||
} else {
|
||||
logrus.Warn("not enforcing for usage with no share token: %v", usage.String())
|
||||
logrus.Warnf("not enforcing for usage with no share token: %v", usage.String())
|
||||
}
|
||||
|
||||
case <-time.After(a.cfg.Cycle):
|
||||
|
@ -45,8 +45,12 @@ func (a *Agent) Start() error {
|
||||
select {
|
||||
case event := <-a.events:
|
||||
if usage, err := Ingest(event.Data()); err == nil {
|
||||
if err := a.cache.addZrokDetail(usage); err != nil {
|
||||
logrus.Errorf("unable to add zrok detail for: %v: %v", usage.String(), err)
|
||||
if usage.AccountId != 0 || usage.EnvironmentId != 0 {
|
||||
if err := a.cache.addZrokDetail(usage); err != nil {
|
||||
logrus.Errorf("unable to add zrok detail for: %v: %v", usage.String(), err)
|
||||
}
|
||||
} else {
|
||||
logrus.Debugf("skipping zrok detail for: %v", usage.String())
|
||||
}
|
||||
shouldAck := true
|
||||
for _, snk := range a.snks {
|
||||
@ -64,9 +68,6 @@ func (a *Agent) Start() error {
|
||||
}
|
||||
} else {
|
||||
logrus.Errorf("unable to ingest '%v': %v", event.Data(), err)
|
||||
if err := event.Ack(); err != nil {
|
||||
logrus.Errorf("unable to ack unparseable message: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user