diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-06-20 20:14:35 +0300 |
---|---|---|
committer | Austin S. Hemmelgarn <ahferroin7@gmail.com> | 2024-06-21 08:33:46 -0400 |
commit | 280bce69c294b81c7baf6ddf3b8043882be4197c (patch) | |
tree | 1de9316f2338dd0fb0e261b69291202f80213434 /src | |
parent | cbede9acfb46267d5f5ac2e6a7231a2fada227fa (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") } |