2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 03:44:52 +00:00

configDB.pm: show version counter in save message

git-svn-id: https://svn.fhem.de/fhem/trunk@27886 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2023-08-23 19:44:12 +00:00
parent d14372ee04
commit c06dc6db15
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: configDB.pm: show version counter in "configDB saved. (xx)"
- feature: 93_DbLog: possible use of alternative tables for SVG Plots
Forum:134547, fix warnings
- change: 98_DOIFtools: delete Internal DEF.

View File

@ -184,6 +184,8 @@
#
# 2023-08-07 - fixed missing uuid in migration process
#
# 2023-08-23 - added show version counter in save message
#
##############################################################################
=cut
@ -532,7 +534,8 @@ sub cfgDB_SaveCfg { ## prototype used in fhem.pl
# Insert @rowList into database table
my $fhem_dbh = _cfgDB_Connect;
my $uuid = _cfgDB_Rotate($fhem_dbh,$internal);
my ($num,$uuid) = split(/\:/,_cfgDB_Rotate($fhem_dbh,$internal));
Debug "num: $num uuid: $uuid";
my $counter = 0;
foreach (@rowList) {
_cfgDB_InsertLine($fhem_dbh, $uuid, $_, $counter);
@ -543,7 +546,7 @@ sub cfgDB_SaveCfg { ## prototype used in fhem.pl
my $maxVersions = $configDB{attr}{maxversions};
$maxVersions = ($maxVersions) ? $maxVersions : 0;
_cfgDB_Reorg($maxVersions,1) if($maxVersions && $internal != -1);
return 'configDB saved.';
return "configDB saved. ($num)";
}
# save statefile
@ -861,7 +864,7 @@ sub _cfgDB_Rotate {
$fhem_dbh->do("INSERT INTO fhemversions values ('$newversion', '$uuid', NULL)");
Log3(undef,1,"configDB: more than 20 versions in database! Please consider setting a limit.")
if ($count > 20 && !defined($configDB{attr}{maxversions}));
return $uuid;
return "$count:$uuid";
}
sub _cfgDB_filesize_str {