mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 07:24:21 +00:00
98_update.pm: deny duplicate executions (Forum #68313)
git-svn-id: https://svn.fhem.de/fhem/trunk@13612 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
45e22fa235
commit
e578ad5d8e
@ -27,6 +27,7 @@ my $mainPgm = "/fhem.pl\$";
|
|||||||
my %upd_connecthash;
|
my %upd_connecthash;
|
||||||
my $upd_needJoin;
|
my $upd_needJoin;
|
||||||
my $upd_nChanged;
|
my $upd_nChanged;
|
||||||
|
my $upd_running;
|
||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@ -69,14 +70,18 @@ CommandUpdate($$)
|
|||||||
$updateInBackground = AttrVal("global","updateInBackground",1);
|
$updateInBackground = AttrVal("global","updateInBackground",1);
|
||||||
$updateInBackground = 0 if($arg ne "all");
|
$updateInBackground = 0 if($arg ne "all");
|
||||||
$updArg = $arg;
|
$updArg = $arg;
|
||||||
|
return "An update is already running" if($upd_running);
|
||||||
|
$upd_running = 1;
|
||||||
if($updateInBackground) {
|
if($updateInBackground) {
|
||||||
CallFn($cl->{NAME}, "ActivateInformFn", $cl, "log");
|
CallFn($cl->{NAME}, "ActivateInformFn", $cl, "log");
|
||||||
BlockingCall("doUpdateInBackground", {src=>$src,arg=>$arg});
|
sub updDone(@) { $upd_running=0 }
|
||||||
|
BlockingCall("doUpdateInBackground", {src=>$src,arg=>$arg}, "updDone");
|
||||||
return "Executing the update the background.";
|
return "Executing the update the background.";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
doUpdateLoop($src, $arg);
|
doUpdateLoop($src, $arg);
|
||||||
my $ret = $updRet; $updRet = "";
|
my $ret = $updRet; $updRet = "";
|
||||||
|
$upd_running = 0;
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user