Skip to content

Commit 8601242

Browse files
authored
Merge pull request #1375 from umgfoin/PR_fix_wrong_photocache_failure-msg
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.
2 parents a0cfc6b + 79bd524 commit 8601242

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## 1.6.0 - 2025.01.10 Georeferenced photos from external folders not shown on map
7+
## 1.6.0 - [unreleased]
88
### Added
99
- Scan photos of specific directory [#1231](https://github.com/nextcloud/maps/pull/1231) @tetebueno
1010

1111
### Fixed
1212
- Georeferenced photos from external folders not shown on map
1313
[#1371](https://github.com/nextcloud/maps/issues/1371) @umgfoin
14+
- Fix wrong failure-msg. when clearing photo-cache
15+
[#1375](https://github.com/nextcloud/maps/pull/1375) @umgfoin
1416

1517

1618
## 1.5.0 - 2024.11.16 Nextcloud Hub 9

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)