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

View File

@@ -1,4 +1,4 @@
%define release 23 %define release 24
%define version 1.0 %define version 1.0
%define debug_package %{nil} %define debug_package %{nil}
@@ -61,6 +61,9 @@ fi
%changelog %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 * Mon Sep 22 2025 Brian Read <brianr@koozali.org> 1.0-23.sme
- add debuginfo define to suppress it [SME: 13168] - add debuginfo define to suppress it [SME: 13168]
- Fix config call in layout [SME: 13168] - Fix config call in layout [SME: 13168]