* Updated Database->connect() to allow local reads on strikers, regardless of the active DB.

Signed-off-by: digimer <digimer@gravitar.alteeve.com>
main
digimer 2 years ago
parent 98c3868870
commit 26a1fe1491
  1. 7
      Anvil/Tools/Database.pm
  2. 1
      Anvil/Tools/System.pm

@ -1739,9 +1739,10 @@ sub connect
"db_status::${uuid}::active" => $anvil->data->{db_status}{$uuid}{active},
}});
# We always use the first DB we connect to, even if we're a DB ourselves. This helps
# with consistency and leaves second (or third...) as backups.
if (not $anvil->data->{sys}{database}{read_uuid})
# We always use the first DB we connect to, unless we've got a local DB. We always
# prefer local as there could be data locally that hasn't yet been sync'ed with the
# peer.
if (($is_local) or (not $anvil->data->{sys}{database}{read_uuid}))
{
$anvil->data->{sys}{database}{read_uuid} = $uuid;
$anvil->Database->read({set => $anvil->data->{cache}{database_handle}{$uuid}});

@ -630,6 +630,7 @@ sub check_if_configured
{
# Write the database entry.
my $variable_uuid = $anvil->Database->insert_or_update_variables({
debug => 2,
variable_name => "system::configured",
variable_value => 1,
variable_default => "",

Loading…
Cancel
Save