@ -112,23 +112,11 @@ my $check_if_database_is_configured = 0;
# These are the things we always want running.
# These are the things we always want running.
while(1)
while(1)
{
{
# C onnect to the database(s)
# Reload defaults, re-read the config and then c onnect to the database(s)
$anvil->Storage->read_config({force_read => 1, file => $anvil->data->{path}{configs}{'anvil.conf'}});
$anvil->Storage->read_config({force_read => 1, file => $anvil->data->{path}{configs}{'anvil.conf'}});
$anvil->Database->connect({check_if_configured => $check_if_database_is_configured});
$anvil->Database->connect({check_if_configured => $check_if_database_is_configured});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"});
### DEBUG:
my $db_count = keys %{$anvil->data->{database}};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { db_count => $db_count }});
foreach my $uuid (keys %{$anvil->data->{database}})
{
my $host = $anvil->data->{database}{$uuid}{host};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"s1:uuid" => $uuid,
"s2:host" => $host,
}});
}
# Mark that we don't want to check the database now.
# Mark that we don't want to check the database now.
$check_if_database_is_configured = 0;
$check_if_database_is_configured = 0;
@ -182,22 +170,7 @@ while(1)
}
}
# Disconnect from the database(s) and sleep now.
# Disconnect from the database(s) and sleep now.
$anvil->Database->disconnect({debug => 2});
$anvil->Database->disconnect();
### DEBUG:
$db_count = 0;
$db_count = keys %{$anvil->data->{database}};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { db_count => $db_count }});
foreach my $uuid (keys %{$anvil->data->{database}})
{
my $host = $anvil->data->{database}{$uuid}{host};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"s1:uuid" => $uuid,
"s2:host" => $host,
}});
}
die;
sleep(1);
sleep(1);
}
}