diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -281,6 +281,11 @@ int main( int argc, char **argv ) } // Handle requests rpcHandle( listenFd ); + // Might have set a new scheduled action + if ( nextAction.deadline != 0 && ( count == 0 || minIdleTime >= config.minIdle || nextAction.force ) ) { + int delta = nextAction.deadline - monoNOW; + CAP_SLEEP( delta ); + } // Sleep until next run //printf( "Sleeping %d seconds\n ", sleepTime ); rpcWait( listenFd, sleepTime > 5 ? sleepTime : 5 ); |