Telegram bot becomes unresponsive
I'm using telegram bot to control my application. Unfortunately after some time it becomes unresponsive. Any ideas?
Thread.new{
$telebot.listen do |message|
begin
if message.chat.id != $config['telebot'][:admin].to_i then
next
end
$telebot.api.send_message(chat_id: message.chat.id, text: "\u{1F477} Received your message. Processing")
$telebot_commands.push(message.text)
rescue
end
end
}
Are you sure that thread is really alive all the time? If there would be any exception raised the thread would just silently die.
I've added $@ and $! to the rescue so next time I will have more information. I noticed that when this case happens also Kernel.trap( "INT" ) stops working for the rest of the application
Stopped again, no output from rescue, retry didn't help. Any idea?
Alright, the work around is to check if the Thread is alive and restart it if not. This kinda means that the thread terminates without any error for some reason, would be nice to find somehow out why no exception is thrown
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.