mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
enable linter: revive (early-return) (#3051)
* enable linter: revive (early-return) * lint
This commit is contained in:
parent
d3974894fc
commit
72b6da9925
8 changed files with 58 additions and 66 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue