fix:修复发送api打字时间,现已成为可选参数。修复可能存在的回复图片问题,为数据库缺失字段提供警告
This commit is contained in:
@@ -199,11 +199,11 @@ class NormalChat:
|
||||
# 使用信号量控制并发数,最多同时处理5个消息
|
||||
semaphore = asyncio.Semaphore(5)
|
||||
|
||||
async def limited_process(task):
|
||||
async with semaphore:
|
||||
async def limited_process(task, sem):
|
||||
async with sem:
|
||||
await task
|
||||
|
||||
limited_tasks = [limited_process(task) for task in tasks]
|
||||
limited_tasks = [limited_process(task, semaphore) for task in tasks]
|
||||
await asyncio.gather(*limited_tasks, return_exceptions=True)
|
||||
except asyncio.CancelledError:
|
||||
logger.info(f"[{self.stream_name}] 兴趣监控任务被取消")
|
||||
|
||||
Reference in New Issue
Block a user