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

Python async_timeout 问题

  •  
  •   fangwenxue · 2021-07-16 17:03:27 +08:00 · 437 次点击
    这是一个创建于 986 天前的主题,其中的信息可能已经有所发展或是发生改变。
        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   ·   我们的愿景   ·   实用小工具   ·   5112 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:41 · PVG 13:41 · LAX 22:41 · JFK 01:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.