I was thinking about which would be best and am not sure how one would decide.Only you can say whether or not it should run 24/7 or run on a schedule
When there are issues related to relinquishing hardware control, losing software state or control, having the software run forever seems the best option. The wider adoption of 'libgpiod' can compound issues of relinquishing hardware control as behaviour will depend on what that does on program exit, and which version of that one has.
Otherwise there wouldn't seem to be much difference between the two.
But I have had perfectly good Python code simply hang for no good reason; sometimes in 'requests.get()' where for some reason it doesn't download what's asked for but doesn't throw an error or ever return from that call. That blocks and can stop a 24/7 program dead in its tracks.
A scheduled relaunch might help there but how successful recovery would be probably depend on what the program does, what resources it may have claimed which a subsequent relaunch might need to take back control.
I haven't looked but there might be some guidelines on how to handle hung and crashed applications which may influence what the best choice would be.
Statistics: Posted by hippy — Wed Jul 17, 2024 1:54 pm