fix(store): 修复'crawler_type_var'的不当使用导致csv/json保存文件名异常的bug

This commit is contained in:
persist-1
2025-09-10 23:47:05 +08:00
parent d3bebd039e
commit 0d0af57a01
5 changed files with 11 additions and 11 deletions

View File

@@ -17,12 +17,12 @@ from database.models import XhsNote, XhsNoteComment, XhsCreator
from tools.async_file_writer import AsyncFileWriter
from tools.time_util import get_current_timestamp
from var import crawler_type_var
class XhsCsvStoreImplement(AbstractStore):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.writer = AsyncFileWriter(platform="xhs", crawler_type=kwargs.get("crawler_type"))
self.writer = AsyncFileWriter(platform="xhs", crawler_type=crawler_type_var.get())
async def store_content(self, content_item: Dict):
"""
@@ -51,7 +51,7 @@ class XhsCsvStoreImplement(AbstractStore):
class XhsJsonStoreImplement(AbstractStore):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.writer = AsyncFileWriter(platform="xhs", crawler_type=kwargs.get("crawler_type"))
self.writer = AsyncFileWriter(platform="xhs", crawler_type=crawler_type_var.get())
async def store_content(self, content_item: Dict):
"""