mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 05:01:57 +00:00
fhem.pl: implement prioSave for a small SubProcess (Forum #130588)
git-svn-id: https://svn.fhem.de/fhem/trunk@26775 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2b43014277
commit
de344556fb
@ -219,6 +219,7 @@ sub cfgDB_FileWrite;
|
|||||||
# ShutdownFn-called before shutdown, if DelayedShutdownFn is "over"
|
# ShutdownFn-called before shutdown, if DelayedShutdownFn is "over"
|
||||||
# StateFn - set local info for this device, do not activate anything
|
# StateFn - set local info for this device, do not activate anything
|
||||||
# UndefFn - clean up (delete timer, close fd), called by delete and rereadcfg
|
# UndefFn - clean up (delete timer, close fd), called by delete and rereadcfg
|
||||||
|
# prioSave - save the definition at the start, for a small SubProcess
|
||||||
|
|
||||||
#Special values in %defs:
|
#Special values in %defs:
|
||||||
# TYPE - The name of the module it belongs to
|
# TYPE - The name of the module it belongs to
|
||||||
@ -236,6 +237,7 @@ use vars qw($addTimerStacktrace);# set to 1 by fhemdebug
|
|||||||
use vars qw($auth_refresh);
|
use vars qw($auth_refresh);
|
||||||
use vars qw($cmdFromAnalyze); # used by the warnings-sub
|
use vars qw($cmdFromAnalyze); # used by the warnings-sub
|
||||||
use vars qw($devcount); # Maximum device number, used for storing
|
use vars qw($devcount); # Maximum device number, used for storing
|
||||||
|
use vars qw($devcountPrioSave); # Maximum prioSave device number
|
||||||
use vars qw($unicodeEncoding); # internal encoding is unicode (wide character)
|
use vars qw($unicodeEncoding); # internal encoding is unicode (wide character)
|
||||||
use vars qw($featurelevel);
|
use vars qw($featurelevel);
|
||||||
use vars qw($fhemForked); # 1 in a fhemFork()'ed process, else undef
|
use vars qw($fhemForked); # 1 in a fhemFork()'ed process, else undef
|
||||||
@ -2136,7 +2138,9 @@ CommandDefine($$)
|
|||||||
$hash{TYPE} = $m;
|
$hash{TYPE} = $m;
|
||||||
$hash{STATE} = "???";
|
$hash{STATE} = "???";
|
||||||
$hash{DEF} = $a[2] if(int(@a) > 2);
|
$hash{DEF} = $a[2] if(int(@a) > 2);
|
||||||
$hash{NR} = $devcount++;
|
#130588: start early after next save, for a small SubProcess size
|
||||||
|
$hash{NR} = ($modules{$m}{prioSave} && $devcountPrioSave < 30) ?
|
||||||
|
$devcountPrioSave++ : $devcount++;
|
||||||
$hash{CFGFN} = $currcfgfile
|
$hash{CFGFN} = $currcfgfile
|
||||||
if($currcfgfile ne AttrVal("global", "configfile", "") &&
|
if($currcfgfile ne AttrVal("global", "configfile", "") &&
|
||||||
!configDBUsed());
|
!configDBUsed());
|
||||||
@ -4031,6 +4035,9 @@ doGlobalDef($)
|
|||||||
CommandAttr(undef, "global verbose 3");
|
CommandAttr(undef, "global verbose 3");
|
||||||
CommandAttr(undef, "global configfile $arg");
|
CommandAttr(undef, "global configfile $arg");
|
||||||
CommandAttr(undef, "global logfile -");
|
CommandAttr(undef, "global logfile -");
|
||||||
|
|
||||||
|
$devcountPrioSave = 2;
|
||||||
|
$devcount = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user