BallAerospace / python-ballcosmos

Python Support for Ball Aerospace COSMOS v4
Other
18 stars 4 forks source link

Infinite wait on zero wait time #4

Closed apogeecmb closed 4 years ago

apogeecmb commented 4 years ago

In script/api_shared.py, the cosmos_script_sleep function is causing infinite waits when the sleep_time input parameter has a value of 0. My suggested fix is to change the if check condition on line 692 to "sleep_time != None". This will trigger the infinite wait else branch if no input parameter is passed into the function, but allow a sleep_time value of zero to immediately return without hanging.

This issue occurred when issuing a wait_check command with a non-zero wait time. In the cosmos_script_sleep function, on lines 709-716, the sleep_time is set to zero if the delta time remaining evaluates to less than zero. This was resulting in an undesired infinite wait that required user keyboard input to escape from.

ghost commented 4 years ago

Thanks! This is fixed in version 0.1.2