Open gfdb opened 3 years ago
Changed timeout default from 60 seconds to None to be backwards compatible with existing implementations of the method. Also, made timeout a parameter of Client.accept_friend. It is a parameter of Client.wait_for and asyncio.wait_for so it is a parameter that you should be able to set when calling Client.accept_friend.
The Client.accept_friend method calls the Client.wait_for method without any timeout parameter. As a result, when asyncio.wait_for is called in Client.wait_for,
timeout = None
is passed which causes a block until the futurecheck=lambda f: f.id == user_id
completes. This pull request just adds a 60 second timeout so that, in the event that the future never completes, accept_friend does not block.