feat: 添加爬虫状态更新中的显示支持

在爬虫状态列中增加"正在更新"状态显示,并在爬虫过程中更新状态
This commit is contained in:
dmy
2026-01-22 14:15:07 +08:00
parent eaed16a12e
commit 2475619228
3 changed files with 57 additions and 2 deletions

View File

@@ -49,7 +49,17 @@ export class CrawlerController {
this.crawlingSources.add(sourceName);
try {
// 设置状态为正在更新count = -1
await this.crawlerService.updateCrawlStatus(sourceName, -1);
const result = await this.crawlerService.crawlSingleSource(sourceName);
// 更新状态为实际数量
await this.crawlerService.updateCrawlStatus(
sourceName,
result.success ? result.count : 0,
);
return result;
} finally {
this.crawlingSources.delete(sourceName);