mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
feat(qlik): add step-by-step logging to sync extraction
Logs each stage (PG codes -> NTLM session -> chromium -> csrf token -> in-page ws -> OpenDoc -> SelectValues -> cube size -> rows) so a hanging sync reveals where it stalls. Forwards in-page browser console to the node logger. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
6cdb845a1f
commit
d54c3ae520
2 files changed
+16
-1
No files matched your search
@@ -33,6 +33,7 @@ export async function POST(req: NextRequest) {
|
||||
.filter(Boolean),
|
||||
),
|
||||
];
|
||||
console.log(`[api/qlik/sync] fournisseur=${fournisseur} — ${articles.length} articles, ${codes.length} codes centraux uniques. Échantillon: ${JSON.stringify(codes.slice(0, 5))}`);
|
||||
if (codes.length === 0) {
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
@@ -44,8 +45,11 @@ export async function POST(req: NextRequest) {
|
||||
});
|
||||
}
|
||||
|
||||
console.log(`[api/qlik/sync] → lancement extraction Qlik pour ${codes.length} codes…`);
|
||||
const metrics = await fetchNetworkMetricsPlaywright(codes);
|
||||
console.log(`[api/qlik/sync] ← Qlik a renvoyé ${metrics.size} produits réseau`);
|
||||
const count = await upsertNetworkMetrics([...metrics.values()]);
|
||||
console.log(`[api/qlik/sync] ${count} lignes upsert dans le cache`);
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
fournisseur,
|
||||
|
||||
Reference in new issue
Block a user