File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -348,20 +348,14 @@ protected function defferUpdateCacheConfig(array $config): void
348
348
protected function formatRemediationFromDecision (?array $ decision ): array
349
349
{
350
350
if (!$ decision ) {
351
- /**
352
- * In stream mode we consider a clean IP forever... until the next resync.
353
- * in this case, forever is 10 years as PHP_INT_MAX will cause trouble with the Memcached Adapter
354
- * (int to float unwanted conversion)
355
- *
356
- */
357
- $ duration = $ this ->streamMode ? 315360000 : $ this ->cacheExpirationForCleanIp ;
351
+ $ duration = $ this ->cacheExpirationForCleanIp ;
358
352
359
353
return [Constants::REMEDIATION_BYPASS , time () + $ duration , 0 ];
360
354
}
361
355
362
356
$ duration = self ::parseDurationToSeconds ($ decision ['duration ' ]);
363
357
364
- // Don't set a max duration in stream mode to avoid bugs. Only the stream update has to change the cache state.
358
+ // In stream mode, only the stream update has to change the cache state.
365
359
if (!$ this ->streamMode ) {
366
360
$ duration = min ($ this ->cacheExpirationForBadIp , $ duration );
367
361
}
@@ -432,6 +426,10 @@ protected function miss(string $value, string $cacheScope): string
432
426
]);
433
427
}
434
428
}
429
+ // In stream mode, we do not save bypass decision in cache
430
+ if ($ this ->streamMode && !$ decisions ){
431
+ return Constants::REMEDIATION_BYPASS ;
432
+ }
435
433
436
434
return $ this ->saveRemediationsForCacheKey ($ decisions , $ cacheKey );
437
435
}
You can’t perform that action at this time.
0 commit comments