Commit dc60747a authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add hardwired (2005) holidays array to make sure robot lab stays

closed on Univ Holidays. I hope this daemon is gone before 2006
arrives!
parent e9e9726f
......@@ -52,6 +52,22 @@ $libdb::DBQUERY_MAXTRIES = 30;
my $TBOPSPID = TBOPSPID();
my $logfile = "$TB/log/robolab.log";
#
# Holidays. I know, this is really terrible. I hope that by 2006, this
# daemon will be gone anyway.
#
my %holidays =
("1/17" => 1,
"2/21" => 1,
"5/30" => 1,
"7/4" => 1,
"7/24" => 1,
"9/5" => 1,
"11/24" => 1,
"11/25" => 1,
"12/26" => 1,
);
#
# Turn off line buffering on output (dots ...).
#
......@@ -200,12 +216,14 @@ while (1) {
print "$opentime,$opentime_unix $closetime,$closetime_unix " .
time() . "\n";
}
my $hday = ($mon + 1) . "/" . $mday;
#
# See if we need to make a change.
#
if (time() >= $opentime_unix && time() <= $closetime_unix &&
$wday >= 1 && $wday <= 5) {
$wday >= 1 && $wday <= 5 && !exists($holidays{$hday})) {
#
# Robot lab should be open; make it so if not.
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment