L13 Planung: Geocoding der Objekte über OpenStreetMap Nominatim
Provider-Interface (nominatim|none), strukturierte Suche mit User-Agent und Accept-Language, Drosselung 1/s je Prozess, Job geocode-site (Worker: Concurrency 1 + Limiter), Cache am Objekt, manuelle Koordinaten bleiben, Auslöser Anlage/Adressänderung/Import-Bestätigung nur per Queue, Backfill-Skript, Env-Beispiele. Tests mit Fake-Provider, Nominatim nie aufgerufen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { geocodeSite } from "@/server/services/geo/geocode-site";
|
||||
import type { JobPayload } from "../queues";
|
||||
|
||||
/**
|
||||
* Queue "geocode-site" (L13 Planung): address → coordinates for one site, cached on the row.
|
||||
* The worker runs this queue with concurrency 1 + BullMQ limiter 1/s; the Nominatim provider
|
||||
* additionally throttles process-wide. `failed` is rethrown so BullMQ retries with backoff.
|
||||
*/
|
||||
export async function process(payload: JobPayload): Promise<void> {
|
||||
const outcome = await geocodeSite(payload.tenantId, payload.entityId);
|
||||
if (outcome === "failed") throw new Error("geocoding failed (retry scheduled)");
|
||||
}
|
||||
Reference in New Issue
Block a user