mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
93_DbLog, 93_DbRep: minor fix time until DB is closed
git-svn-id: https://svn.fhem.de/fhem/trunk@17491 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2a2da69bc5
commit
623d675d30
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- change: 93_DbLog, 93_DbRep: minor fix time until DB is closed
|
||||||
- change: 38_netatmo: changed weathermap calls to new endpoints
|
- change: 38_netatmo: changed weathermap calls to new endpoints
|
||||||
- feature: 5.9 released
|
- feature: 5.9 released
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
############################################################################################################################################
|
############################################################################################################################################
|
||||||
# Versions History done by DS_Starter & DeeSPe:
|
# Versions History done by DS_Starter & DeeSPe:
|
||||||
#
|
#
|
||||||
|
# 3.12.2 07.10.2018 $hash->{HELPER}{REOPEN_RUNS_UNTIL} contains the time until the DB is closed
|
||||||
# 3.12.1 19.09.2018 use Time::Local (forum:#91285)
|
# 3.12.1 19.09.2018 use Time::Local (forum:#91285)
|
||||||
# 3.12.0 04.09.2018 corrected SVG-select (https://forum.fhem.de/index.php/topic,65860.msg815640.html#msg815640)
|
# 3.12.0 04.09.2018 corrected SVG-select (https://forum.fhem.de/index.php/topic,65860.msg815640.html#msg815640)
|
||||||
# 3.11.0 02.09.2018 reduceLog, reduceLogNbl - optional "days newer than" part added
|
# 3.11.0 02.09.2018 reduceLog, reduceLogNbl - optional "days newer than" part added
|
||||||
@ -210,7 +211,7 @@ use Time::Local;
|
|||||||
use Encode qw(encode_utf8);
|
use Encode qw(encode_utf8);
|
||||||
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
||||||
|
|
||||||
my $DbLogVersion = "3.12.1";
|
my $DbLogVersion = "3.12.2";
|
||||||
|
|
||||||
my %columns = ("DEVICE" => 64,
|
my %columns = ("DEVICE" => 64,
|
||||||
"TYPE" => 64,
|
"TYPE" => 64,
|
||||||
@ -588,6 +589,7 @@ sub DbLog_Set($@) {
|
|||||||
DbLog_ConnectPush($hash);
|
DbLog_ConnectPush($hash);
|
||||||
if($hash->{HELPER}{REOPEN_RUNS}) {
|
if($hash->{HELPER}{REOPEN_RUNS}) {
|
||||||
delete $hash->{HELPER}{REOPEN_RUNS};
|
delete $hash->{HELPER}{REOPEN_RUNS};
|
||||||
|
delete $hash->{HELPER}{REOPEN_RUNS_UNTIL};
|
||||||
RemoveInternalTimer($hash, "reopen");
|
RemoveInternalTimer($hash, "reopen");
|
||||||
}
|
}
|
||||||
DbLog_execmemcache($hash) if($async);
|
DbLog_execmemcache($hash) if($async);
|
||||||
@ -611,6 +613,7 @@ sub DbLog_Set($@) {
|
|||||||
Log3($name, 2, "DbLog $name: Connection closed until $ts ($a[2] seconds).");
|
Log3($name, 2, "DbLog $name: Connection closed until $ts ($a[2] seconds).");
|
||||||
readingsSingleUpdate($hash, "state", "closed until $ts ($a[2] seconds)", 1);
|
readingsSingleUpdate($hash, "state", "closed until $ts ($a[2] seconds)", 1);
|
||||||
InternalTimer(gettimeofday()+$a[2], "DbLog_reopen", $hash, 0);
|
InternalTimer(gettimeofday()+$a[2], "DbLog_reopen", $hash, 0);
|
||||||
|
$hash->{HELPER}{REOPEN_RUNS_UNTIL} = $ts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ($a[1] eq 'rereadcfg') {
|
elsif ($a[1] eq 'rereadcfg') {
|
||||||
@ -4730,6 +4733,7 @@ sub DbLog_reopen ($){
|
|||||||
if(DbLog_ConnectPush($hash)) {
|
if(DbLog_ConnectPush($hash)) {
|
||||||
# Statusbit "Kein Schreiben in DB erlauben" löschen
|
# Statusbit "Kein Schreiben in DB erlauben" löschen
|
||||||
my $delay = delete $hash->{HELPER}{REOPEN_RUNS};
|
my $delay = delete $hash->{HELPER}{REOPEN_RUNS};
|
||||||
|
delete $hash->{HELPER}{REOPEN_RUNS_UNTIL};
|
||||||
Log3($name, 2, "DbLog $name: Database connection reopened (it was $delay seconds closed).") if($delay);
|
Log3($name, 2, "DbLog $name: Database connection reopened (it was $delay seconds closed).") if($delay);
|
||||||
readingsSingleUpdate($hash, "state", "reopened", 1);
|
readingsSingleUpdate($hash, "state", "reopened", 1);
|
||||||
$hash->{HELPER}{OLDSTATE} = "reopened";
|
$hash->{HELPER}{OLDSTATE} = "reopened";
|
||||||
|
@ -42,6 +42,7 @@ use warnings;
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
our %DbRep_vNotesIntern = (
|
our %DbRep_vNotesIntern = (
|
||||||
|
"8.2.1" => "07.10.2018 \$hash->{dbloghash}{HELPER}{REOPEN_RUNS_UNTIL} contains the time until DB is closed ",
|
||||||
"8.2.0" => "05.10.2018 direct help for attributes ",
|
"8.2.0" => "05.10.2018 direct help for attributes ",
|
||||||
"8.1.0" => "02.10.2018 new get versionNotes command ",
|
"8.1.0" => "02.10.2018 new get versionNotes command ",
|
||||||
"8.0.1" => "20.09.2018 DbRep_getMinTs improved",
|
"8.0.1" => "20.09.2018 DbRep_getMinTs improved",
|
||||||
@ -718,7 +719,7 @@ sub DbRep_Set($@) {
|
|||||||
## keine Aktionen außer die über diesem Eintrag solange Reopen xxxx im DbLog-Device läuft
|
## keine Aktionen außer die über diesem Eintrag solange Reopen xxxx im DbLog-Device läuft
|
||||||
#######################################################################################################
|
#######################################################################################################
|
||||||
if ($hash->{dbloghash}{HELPER}{REOPEN_RUNS} && $opt !~ /\?/) {
|
if ($hash->{dbloghash}{HELPER}{REOPEN_RUNS} && $opt !~ /\?/) {
|
||||||
my $ro = (split(" ",FmtDateTime(gettimeofday()+$hash->{dbloghash}{HELPER}{REOPEN_RUNS})))[1];
|
my $ro = $hash->{dbloghash}{HELPER}{REOPEN_RUNS_UNTIL};
|
||||||
Log3 ($name, 3, "DbRep $name - connection $dblogdevice to db $dbname is closed until $ro - $opt postponed");
|
Log3 ($name, 3, "DbRep $name - connection $dblogdevice to db $dbname is closed until $ro - $opt postponed");
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "connection $dblogdevice to $dbname is closed until $ro - $opt postponed", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "connection $dblogdevice to $dbname is closed until $ro - $opt postponed", 1);
|
||||||
return;
|
return;
|
||||||
@ -954,7 +955,7 @@ sub DbRep_Get($@) {
|
|||||||
return if(IsDisabled($name));
|
return if(IsDisabled($name));
|
||||||
|
|
||||||
if ($hash->{dbloghash}{HELPER}{REOPEN_RUNS} && $opt !~ /\?|procinfo|blockinginfo/) {
|
if ($hash->{dbloghash}{HELPER}{REOPEN_RUNS} && $opt !~ /\?|procinfo|blockinginfo/) {
|
||||||
my $ro = (split(" ",FmtDateTime(gettimeofday()+$hash->{dbloghash}{HELPER}{REOPEN_RUNS})))[1];
|
my $ro = $hash->{dbloghash}{HELPER}{REOPEN_RUNS_UNTIL};
|
||||||
Log3 ($name, 3, "DbRep $name - connection $dblogdevice to db $dbname is closed until $ro - $opt postponed");
|
Log3 ($name, 3, "DbRep $name - connection $dblogdevice to db $dbname is closed until $ro - $opt postponed");
|
||||||
ReadingsSingleUpdateValue ($hash, "state", "connection $dblogdevice to $dbname is closed until $ro - $opt postponed", 1);
|
ReadingsSingleUpdateValue ($hash, "state", "connection $dblogdevice to $dbname is closed until $ro - $opt postponed", 1);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user