1
0
mirror of https://github.com/danog/dns.git synced 2024-11-26 20:14:51 +01:00

Limit cache size by default to 256 entries

Fixes #65.
This commit is contained in:
Niklas Keller 2017-12-16 19:59:47 +01:00
parent 417a4a83f9
commit 16e6d6c22f
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@
"php": ">=7.0",
"amphp/amp": "^2",
"amphp/byte-stream": "^1.1",
"amphp/cache": "^1",
"amphp/cache": "^1.2",
"amphp/file": "^0.2 || ^0.3",
"amphp/parser": "^1",
"amphp/uri": "^0.1",

View File

@ -48,7 +48,7 @@ final class BasicResolver implements Resolver {
private $gcWatcher;
public function __construct(Cache $cache = null, ConfigLoader $configLoader = null) {
$this->cache = $cache ?? new ArrayCache;
$this->cache = $cache ?? new ArrayCache(5000 /* default gc interval */, 256 /* size */);
$this->configLoader = $configLoader ?? (\stripos(PHP_OS, "win") === 0
? new WindowsConfigLoader
: new UnixConfigLoader);