调整图片下载逻辑,定时任务5分钟一次进行图片消息下载存档。
This commit is contained in:
6
main.py
6
main.py
@@ -141,6 +141,12 @@ def jobs(robot: Robot):
|
||||
await manager.update_image_cache()
|
||||
logger.info("图片缓存更新完成")
|
||||
|
||||
# ✅ 每2分钟处理一次待下载的图片消息(串行处理,避免数据库锁竞争)
|
||||
@async_job.every_minutes(5)
|
||||
async def process_pending_images_job():
|
||||
if hasattr(robot, 'message_storage') and robot.message_storage:
|
||||
await robot.message_storage.process_pending_images(minutes_ago=10, batch_size=20)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user