fix: 修复 filter_by_date 类型处理 + _save_to_db rowcount 0 值 bug

This commit is contained in:
2026-05-09 14:06:59 +08:00
parent cad1390534
commit 76b734b0a9
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
from typing import Any, Dict, List
from app.crawler.base import PipelineConfig, PipelineResult
from app.services.filter_service import filter_by_keywords, dedup_by_hash
from app.services.filter_service import dedup_by_hash
class PostCrawlPipeline:
@@ -74,7 +74,7 @@ class PostCrawlPipeline:
result_proxy = await self.db.execute(stmt)
await self.db.commit()
return result_proxy.rowcount or len(values)
return result_proxy.rowcount if result_proxy.rowcount >= 0 else len(values)
async def _send_notifications(self, announcements: List[Dict[str, Any]]) -> int:
return await self.notify.send(announcements)