diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-06-20 20:14:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 20:14:35 +0300 |
commit | 88fe280f226d677bb1704a9b701d2ed2f8d358bc (patch) | |
tree | fe01e47bae91a6d374b374674dafd45df63dbc1d /src | |
parent | 7be6a6cb3630b3372b6c65f26c254d3b6d82b665 (diff) |
fix go.d rspamd unexpected response check (#17974)
Diffstat (limited to 'src')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/rspamd/collect.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/collect.go b/src/go/collectors/go.d.plugin/modules/rspamd/collect.go index 6e204e9b55..bb7f5710da 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/collect.go +++ b/src/go/collectors/go.d.plugin/modules/rspamd/collect.go @@ -15,8 +15,8 @@ import ( type rspamdStats struct { Version string `json:"version"` ConfigId string `json:"config_id"` - Scanned int64 `json:"scanned" stm:"scanned"` - Learned int64 `json:"learned" stm:"learned"` + Scanned *int64 `json:"scanned" stm:"scanned"` + Learned *int64 `json:"learned" stm:"learned"` Actions struct { Reject int64 `json:"reject" stm:"reject"` SoftReject int64 `json:"soft reject" stm:"soft_reject"` @@ -62,7 +62,7 @@ func (r *Rspamd) queryRspamdStats() (*rspamdStats, error) { return nil, err } - if stats.Version == "" || stats.ConfigId == "" || len(stats.FuzzyHashes) == 0 { + if stats.Scanned == nil || stats.Learned == nil { return nil, fmt.Errorf("unexpected response: not rspamd data") } |