fix: 修复 filter_by_date 类型处理 + _save_to_db rowcount 0 值 bug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user