定时任务:每小时检查并解禁429被禁用的token
()
| 187 | # Start 429 auto-unban task |
| 188 | import asyncio |
| 189 | async def auto_unban_task(): |
| 190 | """定时任务:每小时检查并解禁429被禁用的token""" |
| 191 | while True: |
| 192 | try: |
| 193 | await asyncio.sleep(3600) # 每小时执行一次 |
| 194 | await token_manager.auto_unban_429_tokens() |
| 195 | except Exception as e: |
| 196 | print(f"Auto-unban task error: {e}") |
| 197 | |
| 198 | auto_unban_task_handle = asyncio.create_task(auto_unban_task()) |
| 199 | token_manager.start_protocol_refresher() |
no test coverage detected