* Wed Sep 24 2025 Brian Read <brianr@koozali.org> 1.0-24.sme

- Sort out access to DB vis a vis caching [SME: 13168]
This commit is contained in:
2025-09-24 15:04:09 +01:00
parent 03a5304866
commit bd88797db8
2 changed files with 21 additions and 7 deletions

View File

@@ -23,11 +23,10 @@ use SrvMngr qw( theme_list init_session is_normal_password );
use esmith::ConfigDB;
use Net::IP;
our $adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb";
our $cdb = esmith::ConfigDB->open() || die "Couldn't open config DB\n";
our $wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard');
our $ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n";
my $adb;
my $cdb;
my $wdb;
my $ndb;
sub main {
@@ -35,6 +34,8 @@ sub main {
$c->app->log->info($c->log_req);
my %wrg_datas = ();
$wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard');
my $title = $c->l('wrg_FORM_TITLE');
$wrg_datas{'trt'} = 'LST';
@@ -74,6 +75,11 @@ sub do_display {
my $title = $c->l('wrg_FORM_TITLE');
my $modul = '';
$adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb";
$cdb = esmith::ConfigDB->open() || die "Couldn't open config DB\n";
$wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard');
#$ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n";
$wrg_datas{'trt'} = $trt;
if ( $trt eq 'QRC' ) {
@@ -140,6 +146,11 @@ sub do_action {
my $result = '';
my $res = '';
$adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb";
$cdb = esmith::ConfigDB->open() || die "Couldn't open config DB\n";
$wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard');
$ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n";
if ( $trt eq 'QRC' ) {
# NEVER
}
@@ -572,4 +583,4 @@ sub test_for_private_ip {
1
__END__
__END__

View File

@@ -1,4 +1,4 @@
%define release 23
%define release 24
%define version 1.0
%define debug_package %{nil}
@@ -61,6 +61,9 @@ fi
%changelog
* Wed Sep 24 2025 Brian Read <brianr@koozali.org> 1.0-24.sme
- Sort out access to DB vis a vis caching [SME: 13168]
* Mon Sep 22 2025 Brian Read <brianr@koozali.org> 1.0-23.sme
- add debuginfo define to suppress it [SME: 13168]
- Fix config call in layout [SME: 13168]