cache logging was getting hit/miss the wrong way round... forever?

This commit is contained in:
Shish 2019-07-07 14:07:11 +01:00
parent c8563951ce
commit 8ec3690f8e

View file

@ -191,15 +191,15 @@ class Cache
global $_tracer;
$_tracer->begin("Cache Query", ["key"=>$key]);
$val = $this->engine->get($key);
$hit = $val === false ? "hit" : "miss";
$_tracer->end(null, ["result"=>$hit]);
if ($val !== false) {
$res = "hit";
$this->hits++;
return $val;
} else {
$res = "miss";
$this->misses++;
return false;
}
$_tracer->end(null, ["result"=>$res]);
return $val;
}
public function set(string $key, $val, int $time=0)