From e479a664a5da225b99929cf40bef11175e22afbc Mon Sep 17 00:00:00 2001 From: cuizhan <3971687@qq.com> Date: Wed, 13 Aug 2025 16:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dshared=5Fmemory=5Fcache.py?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=B3=A8=E8=A7=A3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复clear_cache方法参数类型:str -> Optional[str] - 修复get_kline_data方法参数类型:str -> Optional[str] - 解决Pylance类型检查警告 --- src/data_process_model/shared_memory_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data_process_model/shared_memory_cache.py b/src/data_process_model/shared_memory_cache.py index 4b05edc..443ea58 100644 --- a/src/data_process_model/shared_memory_cache.py +++ b/src/data_process_model/shared_memory_cache.py @@ -264,7 +264,7 @@ class SharedMemoryKlineCache: print(f"❌ 批量添加K线数据到共享内存失败: {e}") return 0 - def get_kline_data(self, stock_code: str = None, limit: int = 100) -> dict: + def get_kline_data(self, stock_code: Optional[str] = None, limit: int = 100) -> dict: """ 从共享内存获取K线数据 @@ -351,7 +351,7 @@ class SharedMemoryKlineCache: except Exception as e: return {'status': 'error', 'error': str(e)} - def clear_cache(self, stock_code: str = None) -> bool: + def clear_cache(self, stock_code: Optional[str] = None) -> bool: """清理缓存数据""" with self.lock: try: