Answer the question
In order to leave comments, you need to log in
How to catch any error in a golang application and reload the program itself?
How to catch any error in a golang application and reload the program itself?
It happens that there are errors that I have not processed and so that the application does not become at all and then works correctly, you need to somehow restart, but how will the binary launch itself? can I write some .bat file or how is it done at all?
Answer the question
In order to leave comments, you need to log in
Well, if the program crashes on an error, the OS will kill the process as well. Check with cron for the presence of it and run it if it is not there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question