更新首页

This commit is contained in:
cheney
2026-08-06 15:39:59 +08:00
parent ec15f40323
commit 547181d333
23 changed files with 3248 additions and 19 deletions
+12
View File
@@ -0,0 +1,12 @@
require('dotenv').config()
async function main() {
console.log('[News] 开始拉取...')
const t0 = Date.now()
const mod = await import('./fetchers/news.fetcher.js')
const list = await mod.fetchNewsList()
console.log('[News] 拉取 ' + list.length + ' 条, 耗时 ' + ((Date.now() - t0) / 1000).toFixed(1) + 's')
if (list.length === 0) { console.log('[News] 无数据, 跳过'); return }
const r = await mod.persistNews(list)
console.log('[News] 入库: 新增 ' + r.inserted + ' 条, 重复跳过 ' + r.skipped + ' 条')
}
main().catch((e) => { console.error('[News] 失败:', e); process.exit(1) })