Answer the question
In order to leave comments, you need to log in
The program itself turns off without errors, how to make it work forever?
Hello.
There is a program that works correctly, 3-4 hours on the server (I run it through python3 main.py & exit), after that it turns off without error messages.
I will not expose the program code, because there is a lot there.
If you run it on the server without & exit, and look in the debug console (prints), it works as it should, but if you run it in the background, it crashes.
if __name__ == "__main__":
while True:
try:
main()
except Exception as e:
logging_time_update.add_time_update(e)
time.sleep(5)
Answer the question
In order to leave comments, you need to log in
python3 main.py & disown & exit
Better yet, log what she writes:
python3 main.py > main.log 2>&1 & disown & exit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question