mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 03:28:59 +02:00
✨ cache decision in live mode for maximum defaultDecisionTimeout params (#79)
This commit is contained in:
+5
-1
@@ -313,7 +313,11 @@ func handleNoStreamCache(bouncer *Bouncer, remoteIP string) error {
|
||||
return fmt.Errorf("handleNoStreamCache:parseDuration %w", err)
|
||||
}
|
||||
if isLiveMode {
|
||||
bouncer.cacheClient.SetDecision(remoteIP, true, int64(duration.Seconds()))
|
||||
durationSecond := int64(duration.Seconds())
|
||||
if bouncer.defaultDecisionTimeout < durationSecond {
|
||||
durationSecond = bouncer.defaultDecisionTimeout
|
||||
}
|
||||
bouncer.cacheClient.SetDecision(remoteIP, true, durationSecond)
|
||||
}
|
||||
return fmt.Errorf("handleNoStreamCache:banned")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user