From 70298a601f58b53b266c6ce5693d7ea5fdf6306f Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 4 Jan 2024 19:32:16 -0300 Subject: [PATCH] activar jumbo en auto --- db-datos/supermercado.ts | 7 ++++++- scraper/auto.ts | 8 +------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/db-datos/supermercado.ts b/db-datos/supermercado.ts index 1073db6..1e167a0 100644 --- a/db-datos/supermercado.ts +++ b/db-datos/supermercado.ts @@ -4,7 +4,12 @@ export enum Supermercado { Coto = "Coto", Jumbo = "Jumbo", } - +export const supermercados: Supermercado[] = [ + Supermercado.Carrefour, + Supermercado.Coto, + Supermercado.Dia, + Supermercado.Jumbo, +]; export const hosts: { [host: string]: Supermercado } = { "diaonline.supermercadosdia.com.ar": Supermercado.Dia, "www.carrefour.com.ar": Supermercado.Carrefour, diff --git a/scraper/auto.ts b/scraper/auto.ts index 774fea4..482e774 100644 --- a/scraper/auto.ts +++ b/scraper/auto.ts @@ -1,7 +1,7 @@ import { mkdtemp, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { Supermercado, hosts } from "db-datos/supermercado.js"; +import { Supermercado, hosts, supermercados } from "db-datos/supermercado.js"; import PQueue from "p-queue"; import { formatDuration, intervalToDuration } from "date-fns"; import { downloadList } from "./scrap.js"; @@ -13,12 +13,6 @@ import { scrapCotoProducts } from "../link-scrapers/coto.js"; import { scrapCarrefourProducts } from "../link-scrapers/carrefour.js"; import { scrapJumboProducts } from "../link-scrapers/jumbo.js"; -const supermercados: Supermercado[] = [ - Supermercado.Carrefour, - Supermercado.Coto, - Supermercado.Dia, -]; - // hacemos una cola para el scrapeo para no tener varios writers a la BD y no sobrecargar la CPU const scrapQueue = new PQueue({ concurrency: 4 });