mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 11:36:20 +00:00
activar jumbo en auto
This commit is contained in:
parent
f154053204
commit
70298a601f
2 changed files with 7 additions and 8 deletions
|
@ -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,
|
||||
|
|
|
@ -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 });
|
||||
|
||||
|
|
Loading…
Reference in a new issue