Answer the question
In order to leave comments, you need to log in
How to find the cause of its hang in a python script?
Guys, hello.
I have a python script that checks the given mail via IMAP every 10 seconds, and if there is a new message (last id), then it takes the letter to its INBOX folder and from there immediately sends it to my telegram bot. But every two days something happens and letters start to accumulate in the INBOX folder that the script created and, accordingly, the messages stop going to telegrams until I clean this folder.
How can you find the reason for this behavior? Can debugging be enabled? Please share your experiences/options.
Answer the question
In order to leave comments, you need to log in
The main.py script itself https://pastebin.com/LSABKQm6
Next to it I have a config.ini file
[email]
host = host.ru #где ищем почту
login = [email protected]
password = 5555555
last_uid = 82 # при первом запуске ID должен сформироваться сам
[telegram]
token = 65785689768769aEGOEYyG2s # бот
chat_id = -40876800 # группа
#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
echo "START"
source $BASEDIR/send_tickets/bin/activate
python $BASEDIR/main.py
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question