summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 316aec5..138713f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -316,9 +316,12 @@ int main( int argc, char **argv )
//printf( "Sleeping %d seconds\n ", sn );
if ( rpc_wait( listenFd, sn < 1 ? 1 : sn ) ) {
rpc_handle( listenFd );
- // Might have set a new scheduled action, run main loop again
if ( nextAction.deadline != oldDeadline ) {
+ // Might have set a new scheduled action, run main loop again soon
CAP_SLEEP( 1 );
+ } else {
+ // Otherwise, still update rather quickly, in case we get polled again
+ CAP_SLEEP( 5 );
}
}
// Detect time changes
@@ -329,6 +332,7 @@ int main( int argc, char **argv )
// Adjust for clock changes
const int diff = ( endWall - startWall ) - ( endMono - startMono );
if ( diff != 0 ) {
+ printf( "Correcting time by %d seconds\n", diff );
for ( idx = 0; idx < count; ++idx ) {
if ( users[idx].display[0] == '\0' )
continue;