V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
fangwenxue
V2EX  ›  问与答

Python async_timeout 问题

  •  
  •   fangwenxue · 2021-07-16 17:03:27 +08:00 · 445 次点击
    这是一个创建于 1008 天前的主题,其中的信息可能已经有所发展或是发生改变。
        async def async_timeout_run(self, callback):
            try:
                async with async_timeout.timeout(60):
                    await getattr(self, callback)()
            except asyncio.TimeoutError as t:
                self.logger.warning(t)
    
    
    await self.async_timeout_run('delete_api')
    
    • delete_api 这个方法执行超过 60 秒没有抛异常,一直在执行
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2461 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:47 · PVG 23:47 · LAX 08:47 · JFK 11:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.