Nichtbetrachten und Daten zusammen
This commit is contained in:
@@ -33,21 +33,15 @@ export async function POST() {
|
||||
});
|
||||
}
|
||||
|
||||
const n8nBaseUrl = process.env.APP_WEBHOOK_URL || 'https://n8n.prinz-pilaw.de/webhook-test/scrape-reviews';
|
||||
|
||||
// Für ALLE aktiven Hotels nur den Preis-Scan anwerfen (OHNE n8n / OHNE LLM)
|
||||
for (const hotel of activeHotels) {
|
||||
const n8nWebhookUrl = n8nBaseUrl.includes('?')
|
||||
? `${n8nBaseUrl}&hotelId=${hotel.id}`
|
||||
: `${n8nBaseUrl}?hotelId=${hotel.id}`;
|
||||
|
||||
// Direkt-URL zur Next.js App für Preishistorie
|
||||
const appWebhookUrl = `http://172.17.0.1:3002/api/webhooks/scraper?hotelId=${hotel.id}`;
|
||||
|
||||
await scrapeQueue.add('scrape-hotel', {
|
||||
hotelId: hotel.id,
|
||||
url: hotel.booking_url,
|
||||
appWebhookUrl, // Für Preishistorie in Postgres
|
||||
webhookUrl: n8nWebhookUrl, // Für n8n KI-Reviews
|
||||
appWebhookUrl, // Speichert den Preis in Postgres
|
||||
webhookUrl: null, // KEIN n8n -> KOSTENLOS!
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,13 +49,10 @@ export async function POST() {
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: `${activeHotels.length} Scrape-Jobs erfolgreich gestartet.`,
|
||||
message: `Preis-Scan für ${activeHotels.length} Hotels gestartet.`,
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error('Fehler beim Starten der Jobs:', error);
|
||||
return NextResponse.json(
|
||||
{ success: false, error: error.message },
|
||||
{ status: 500 }
|
||||
);
|
||||
console.error('Fehler beim Starten des Preis-Scans:', error);
|
||||
return NextResponse.json({ success: false, error: error.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user