pimoroni / clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
MIT License
125 stars 40 forks source link

Busy looping #5

Closed campag closed 7 years ago

campag commented 7 years ago

Ref https://github.com/pimoroni/clean-shutdown/blob/master/daemon/usr/bin/cleanshutd#L99

Looks like that sleep $polling_rate should be in the outer while loop. CPU usage plummets when I move it one line below.

Regards David.

Gadgetoid commented 7 years ago

Looks like you're right- where it is now it wouldn't have any effect unless the button is pressed.

RogueM commented 7 years ago

ha! fixed!