Get or create a singleton instance for the given platform and crawler type Args: platform: Platform name (xhs, dy, ks, etc.) crawler_type: Type of crawler (search, detail, creator) Returns: ExcelStoreBase instance
(cls, platform: str, crawler_type: str)
| 62 | |
| 63 | @classmethod |
| 64 | def get_instance(cls, platform: str, crawler_type: str) -> "ExcelStoreBase": |
| 65 | """ |
| 66 | Get or create a singleton instance for the given platform and crawler type |
| 67 | |
| 68 | Args: |
| 69 | platform: Platform name (xhs, dy, ks, etc.) |
| 70 | crawler_type: Type of crawler (search, detail, creator) |
| 71 | |
| 72 | Returns: |
| 73 | ExcelStoreBase instance |
| 74 | """ |
| 75 | key = f"{platform}_{crawler_type}" |
| 76 | with cls._lock: |
| 77 | if key not in cls._instances: |
| 78 | cls._instances[key] = cls(platform, crawler_type) |
| 79 | return cls._instances[key] |
| 80 | |
| 81 | @classmethod |
| 82 | def flush_all(cls): |
no outgoing calls