refactor(notifications, place-photos, backup): async DB-touching methods; transactions through UnitOfWork

This commit is contained in:
jubnl
2026-09-22 00:22:11 +02:00
parent fac181f45b
commit 4df2d83137
24 changed files with 285 additions and 250 deletions
+2 -2
View File
@@ -2722,7 +2722,7 @@ export class MapsService {
const noPhoto = { photoUrl: null, attribution: null };
// Recent miss — don't hammer the API
if (this.photoCache.getErrored(placeId)) return noPhoto;
if (await this.photoCache.getErrored(placeId)) return noPhoto;
// Deduplicate concurrent requests for the same placeId
const existing = this.photoCache.getInFlight(placeId);
@@ -2860,7 +2860,7 @@ export class MapsService {
const fallback = await fetchWikimediaFallback();
if (fallback) return fallback;
this.photoCache.markError(placeId, providerFailed ? 'provider-error' : 'no-photo');
await this.photoCache.markError(placeId, providerFailed ? 'provider-error' : 'no-photo');
return null;
} finally {
releasePhotoFetchSlot();