From 1dfe5ede6701c2c44c15a55e50e41f6e909a6897 Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Thu, 16 Jul 2026 16:31:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(crawler):=20=E4=BF=AE=E5=A4=8D=20cron=20?= =?UTF-8?q?=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=B7=A5=E4=BD=9C=E6=97=A5=E9=99=90?= =?UTF-8?q?=E5=88=B6(1-5)=EF=BC=8C=E6=94=B9=E4=B8=BA=E6=AF=8F=E5=A4=A9?= =?UTF-8?q?=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 生产 DB: 中电建 0 8 * * 1-5 → 0 8 * * * (每天早8点,含周末) - 生产 DB: 新矿 5 8 * * 1-5 → 5 8 * * * (每天早8:05,含周末) - 生产 DB: 重激活新矿采集器(paused→active) - seed.ts: 同步修正, 避免未来 db:init 再次写入 1-5 - PM2 已重启使新 cron 生效 说明: 1-5 = 周一至周五, 去掉后变为每天执行。 用户可在前端「采集器配置」下拉框自由切换: 每4小时 / 每6小时 / 每天早8点/晚7点 / 手动 --- apps/api/prisma/seed.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/prisma/seed.ts b/apps/api/prisma/seed.ts index acfbe20..684b8a9 100644 --- a/apps/api/prisma/seed.ts +++ b/apps/api/prisma/seed.ts @@ -120,8 +120,8 @@ async function main() { await prisma.crawlerConfig.deleteMany() await prisma.crawlerConfig.createMany({ data: [ - { name: '中国电建阳光采购网', targetUrl: 'https://bid.powerchina.cn', type: 'bid_powerchina', sourceName: '中电建', status: 'active', schedule: '0 8 * * 1-5', totalRuns: 286, successRuns: 275, failedRuns: 11, keywords: '["电缆","防火门","配电箱","钢材"]' }, - { name: '新矿集团供应链平台', targetUrl: 'https://xkgroup.kdcloud.com', type: 'bid_xkgroup', sourceName: '新矿集团', scriptPath: 'fetch-xkgroup.py', status: 'active', schedule: '5 8 * * 1-5', totalRuns: 142, successRuns: 138, failedRuns: 4, keywords: '["电缆","钢材","阀门","管材"]' }, + { name: '中国电建阳光采购网', targetUrl: 'https://bid.powerchina.cn', type: 'bid_powerchina', sourceName: '中电建', status: 'active', schedule: '0 8 * * *', totalRuns: 286, successRuns: 275, failedRuns: 11, keywords: '["电缆","防火门","配电箱","钢材"]' }, + { name: '新矿集团供应链平台', targetUrl: 'https://xkgroup.kdcloud.com', type: 'bid_xkgroup', sourceName: '新矿集团', scriptPath: 'fetch-xkgroup.py', status: 'active', schedule: '5 8 * * *', totalRuns: 142, successRuns: 138, failedRuns: 4, keywords: '["电缆","钢材","阀门","管材"]' }, { name: '中核集团电子采购平台', targetUrl: 'https://www.cnncecp.com', type: 'bid_cnncecp', sourceName: '中核集团', scriptPath: 'fetch-cnncecp.py', status: 'paused', totalRuns: 0, successRuns: 0, failedRuns: 0, keywords: '["电缆","防火门","钢材","阀门"]' }, ], })