dev #44
@@ -511,8 +511,11 @@ export class VehiclesService {
|
||||
const corgiKnown = false;
|
||||
let brandName: string | null = null;
|
||||
|
||||
// ── Parallel: PartsCatalogs + EMEX (EMEX capped at 3s) ──────────────
|
||||
const EMEX_RACE_MS = 3000;
|
||||
// ── Parallel: PartsCatalogs + EMEX (EMEX capped by EMEX_RACE_MS) ──────────────
|
||||
// EMEX HTTP scrapes typically answer in ~4-5s; the old 3s cap abandoned those
|
||||
// wins and forced a PL24 fallback that doesn't cover EMEX-only brands. Give EMEX
|
||||
// a realistic window (env-tunable), still well inside the 25s decode budget.
|
||||
const EMEX_RACE_MS = Number(process.env.EMEX_RACE_MS) || 8000;
|
||||
|
||||
const pcatStart = Date.now();
|
||||
let pcatResolved = false;
|
||||
@@ -544,7 +547,7 @@ export class VehiclesService {
|
||||
}
|
||||
});
|
||||
|
||||
// Emex result capped at 3s — if it doesn't arrive in time, falls back to PL24
|
||||
// Emex result capped by EMEX_RACE_MS — if it doesn't arrive in time, fall back to PL24
|
||||
const emexTimedPromise = Promise.race([
|
||||
emexBasePromise,
|
||||
new Promise<null>((resolve) => setTimeout(() => resolve(null), EMEX_RACE_MS)),
|
||||
|
||||
Reference in New Issue
Block a user