Commit bca01cac authored by Robert Ricci's avatar Robert Ricci

Reload node information from the database if we get an event for a

node we don't know about. This will prevent the case where a new node
is referenced within an hour of it first being added to the nodes
table.
parent f85631f1
......@@ -272,8 +272,17 @@ sub stateTransition($$) {
$oldstate = $nodes{$node}{state};
$mode = $nodes{$node}{mode};
} else {
notify("Got an event for a node ($node) I don't know ".
"about\n");
#
# Try reloading the cache once before we give up on this node
#
reload();
if ($nodes{$node}) {
$oldstate = $nodes{$node}{state};
$mode = $nodes{$node}{mode};
} else {
notify("Got an event for a node ($node) I don't know ".
"about\n");
}
}
if ($oldstate && $mode && $valid{$mode} && $valid{$mode}{$oldstate} &&
!$valid{$mode}{$oldstate}{$newstate}) {
......
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