Skip to content

Commit 0709887

Browse files
committed
Fix wrong failure-msg when clearing photo-cache.
bool GeophotoService::clearCache returns false, if any of the cleared caches was already empty. Accordingly a failure-msg is shown in the maps-GUI. This change makes the function always return true unless an exception occurred - then false is returned. Signed-off-by: umgfoin <[email protected]>
1 parent a0cfc6b commit 0709887

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/Service/GeophotoService.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,16 @@ public function __construct(
7474
* @return bool
7575
*/
7676
public function clearCache(string $userId = ''): bool {
77-
$a = $this->photosCache->clear($userId);
78-
$b = $this->timeOrderedPointSetsCache->clear($userId);
79-
$c = $this->backgroundJobCache->clear('recentlyAdded:'.$userId);
80-
$d = $this->backgroundJobCache->clear('recentlyUpdated:'.$userId);
81-
return $a and $b and $c and $d;
77+
try {
78+
$this->photosCache->clear($userId);
79+
$this->timeOrderedPointSetsCache->clear($userId);
80+
$this->backgroundJobCache->clear('recentlyAdded:'.$userId);
81+
$this->backgroundJobCache->clear('recentlyUpdated:'.$userId);
82+
return true;
83+
84+
} catch (\Exception $e) {
85+
return false;
86+
}
8287
}
8388

8489
/**

0 commit comments

Comments
 (0)