fangwenxue
V2EX  ›  问与答

Python async_timeout 问题

  •  
  •   fangwenxue · Jul 16, 2021 · 1117 views
    This topic created in 1820 days ago, the information mentioned may be changed or developed.
        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 秒没有抛异常,一直在执行
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3099 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 06:03 · PVG 14:03 · LAX 23:03 · JFK 02:03
    ♥ Do have faith in what you're doing.