Explorar o código

Only allow updates every 15 seconds

Zachary Kotlarek %!s(int64=13) %!d(string=hai) anos
pai
achega
729ef54475
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      dmx/projectorPower.pl

+ 4 - 0
dmx/projectorPower.pl

@@ -22,6 +22,7 @@ my $PROJ_SOCK    = $DATA_DIR . 'PROJECTOR.socket';
 my $PUSH_TIMEOUT = 20;
 my $PULL_TIMEOUT = $PUSH_TIMEOUT * 3;
 my $DELAY        = $PULL_TIMEOUT / 2;
+my $CMD_DELAY    = 15;
 
 # Debug
 my $DEBUG = 0;
@@ -185,6 +186,9 @@ while (1) {
 
 		# Clear the lastCount
 		$lastCount = -1;
+
+		# Wait before accepting a new command
+		sleep($CMD_DELAY)
 	}
 
 	# Announce a pending shutdown every minute