-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TgLongPoll locks the thread after working some time #258
Comments
No, that's not supposed to happen. How long does it take for the thread to be locked? |
The main problem is that I don't know any reason for this to happen. I didn't wait the thread to be unlocked. I waited only for 2 hours and then I restarted the program for it to work. |
I had a thought that the issue might appear due to internet connection instability but I tested out turning off internet and turning it in back and the reconnection was done without any troubles, so I believe it is not the case. |
I have added some descriptions above but I didn't measure in time after waiting for 2 hours. |
So, the problem is that I have such code which start the whole bot workflow:
while (true) { try { setEvents(); printf("Bot username: %s\n", bot->getApi().getMe()->username.c_str()); TgBot::TgLongPoll longPoll(*bot); while (true) { printf("Long poll started\n"); longPoll.start(); } } catch (...) { printf("Error. Restart is happening \n"); bot.reset(new Bot{ token }); } }
After some time of bot working, the longPoll.start() locks the whole thread and stops doing anything. is there a reason for such behaviour and is there a way to handle it?
The text was updated successfully, but these errors were encountered: