mirror of
https://github.com/danog/dns.git
synced 2024-11-30 04:29:06 +01:00
Fix memory cache lookup handling
This commit is contained in:
parent
6df50e2fc8
commit
10bd03789c
@ -23,15 +23,12 @@ class MemoryCache implements Cache
|
||||
*/
|
||||
public function resolve($name, $type, callable $callback)
|
||||
{
|
||||
if (isset($this->data[$type][$name])) {
|
||||
if ($this->data[$type][$name][1] >= time()) {
|
||||
$callback($this->data[$type][$name][0]);
|
||||
}
|
||||
|
||||
if (!isset($this->data[$type][$name]) || $this->data[$type][$name][1] < time()) {
|
||||
unset($this->data[$type][$name]);
|
||||
$callback(null);
|
||||
} else {
|
||||
$callback($this->data[$type][$name][0]);
|
||||
}
|
||||
|
||||
$callback($this->data[$type][$name][0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user