Skip to content

Commit 000eee4

Browse files
authored
Merge pull request #34 from crowdsecurity/fix-long-duration
fix memached edge case
2 parents 31b60d0 + c978c6e commit 000eee4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ApiCache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private function formatRemediationFromDecision(?array $decision): array
213213
$duration = time() + $this->cacheExpirationForCleanIp;
214214
if (!$this->liveMode) {
215215
// In stream mode we considere an clean IP forever... until the next resync.
216-
$duration = \PHP_INT_MAX;
216+
$duration = 315360000; // in this case, forever is 10 years as PHP_INT_MAX will cause trouble with the Memcached Adapter (int to float unwanted conversion)
217217
}
218218

219219
return [Constants::REMEDIATION_BYPASS, $duration, 0];

0 commit comments

Comments
 (0)