def create_cleanup(gh):
def cleanup(_):
# We do this just to shut up Twisted.
pool = treq._utils.get_global_pool()
pool.closeCachedConnections()
# We need to sleep to let the connections hang up.
return ensureDeferred(gh.sleep(0.5))
return cleanup
评论列表
文章目录