Prevent cacheKey is not set.

This commit is contained in:
David Molineus
2018-08-23 14:48:58 +02:00
parent f60ed1b7be
commit 9e0f11ec18
2 changed files with 7 additions and 3 deletions

View File

@@ -206,7 +206,10 @@ class MapProvider
$model = $this->getModel($mapId);
}
if ($model->cache) {
$cacheKey = null;
$doCache = $model->cache;
if ($doCache) {
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
if ($this->cache->contains($cacheKey)) {
@@ -219,7 +222,7 @@ class MapProvider
$buffer = $this->doGenerate($model, $filter, $elementId, $template, $style);
if ($model->cache) {
if ($doCache) {
$this->cache->save(
$cacheKey,
[