Skip to content

Add ConnectWithTimeout method to support having a timeout when connecting.#596

Open
ALiwoto wants to merge 2 commits intotulir:mainfrom
ALiwoto:main
Open

Add ConnectWithTimeout method to support having a timeout when connecting.#596
ALiwoto wants to merge 2 commits intotulir:mainfrom
ALiwoto:main

Conversation

@ALiwoto
Copy link

@ALiwoto ALiwoto commented May 24, 2024

This pull request adds a new method called ConnectWithTimeout to support having a timeout set when connecting to whatsapp. This context.Conext is later on passed to fs and is used when connecting (previously, we have been using context.Backgound() for the fs).
Can also use context.Background() if we do not want any timeout.

@ALiwoto ALiwoto changed the title Add timeout support to Connect() methods. Add ConnectWithTimeout method to support having a timeout when connecting. May 24, 2024
@blaggacao
Copy link

Can you say a word or two about the motivation and concrete failure mode which triggered this?

I'm seeing timeout related issues and wonder if this was indirectly made to address a functionally equal failure mode as the one I observe.

Details

I'm not currently using a timeout on the service, but when connecting to the whatsmeow service socket, I use a timeout of 15 seconds within the application. This seems to cause cascading issues some times.

@huzairuje
Copy link

@blaggacao i think this PR should be implemented, i have an issue sometimes the server got internet issue and we don't have any problem regarding how to connect using timeout or context cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants