enable linter: revive (early-return) (#3051)

* enable linter: revive (early-return)

* lint
This commit is contained in:
mmetc 2024-06-07 16:53:23 +02:00 committed by GitHub
parent d3974894fc
commit 72b6da9925
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 58 additions and 66 deletions

View file

@ -86,12 +86,11 @@ func CrowdsecCTI(params ...any) (any, error) {
if val, err := CTICache.Get(ip); err == nil && val != nil {
ctiClient.Logger.Debugf("cti cache fetch for %s", ip)
ret, ok := val.(*cticlient.SmokeItem)
if !ok {
ctiClient.Logger.Warningf("CrowdsecCTI: invalid type in cache, removing")
CTICache.Remove(ip)
} else {
if ok {
return ret, nil
}
ctiClient.Logger.Warningf("CrowdsecCTI: invalid type in cache, removing")
CTICache.Remove(ip)
}
if !CTIBackOffUntil.IsZero() && time.Now().Before(CTIBackOffUntil) {