Spaces:
Runtime error
Runtime error
| import asyncio | |
| import sys | |
| import os | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) | |
| from packages.core.logger import app_logger | |
| from packages.connectors.mock.extended_mock import ExtendedMockConnector, COUNTRY_CONFIGS | |
| from packages.core.database import AsyncSessionLocal | |
| async def run_extended_mock_jobs(): | |
| """ | |
| 循环跑批处理 7 个新国家的采集任务 | |
| """ | |
| async with AsyncSessionLocal() as session: | |
| for country_code in COUNTRY_CONFIGS.keys(): | |
| app_logger.info(f"--- Starting Sync Job for {country_code} ---") | |
| connector = ExtendedMockConnector(country_code=country_code, session=session) | |
| await connector.run() | |
| app_logger.info(f"--- Finished Sync Job for {country_code} ---") | |
| if __name__ == "__main__": | |
| asyncio.run(run_extended_mock_jobs()) | |