feat(wds): limit force sync to terenuri + cladiri only
Manual trigger now only processes sync_terenuri and sync_cladiri steps. import_nogeom and enrich are left for the regular weekend window. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -157,11 +157,18 @@ export async function POST(request: Request) {
|
||||
name?: string;
|
||||
county?: string;
|
||||
priority?: number;
|
||||
onlySteps?: string[];
|
||||
};
|
||||
|
||||
// Trigger is handled separately — starts sync immediately
|
||||
if (body.action === "trigger") {
|
||||
const result = await triggerForceSync();
|
||||
const validSteps = ["sync_terenuri", "sync_cladiri", "import_nogeom", "enrich"] as const;
|
||||
const onlySteps = body.onlySteps?.filter((s): s is (typeof validSteps)[number] =>
|
||||
(validSteps as readonly string[]).includes(s),
|
||||
);
|
||||
const result = await triggerForceSync(
|
||||
onlySteps && onlySteps.length > 0 ? { onlySteps } : undefined,
|
||||
);
|
||||
if (!result.started) {
|
||||
return NextResponse.json(
|
||||
{ error: result.reason },
|
||||
|
||||
Reference in New Issue
Block a user