Added check to sleep to make sure there is work to be done before waiting to execute
Auto-merge | Integrating changes from apache/master