From e578ad5d8e1b84c4517bb6ace38a46784f1c5e8a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 5 Mar 2017 17:48:27 +0000 Subject: [PATCH] 98_update.pm: deny duplicate executions (Forum #68313) git-svn-id: https://svn.fhem.de/fhem/trunk@13612 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_update.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/98_update.pm b/fhem/FHEM/98_update.pm index 1b72a3f4e..197ec3072 100644 --- a/fhem/FHEM/98_update.pm +++ b/fhem/FHEM/98_update.pm @@ -27,6 +27,7 @@ my $mainPgm = "/fhem.pl\$"; my %upd_connecthash; my $upd_needJoin; my $upd_nChanged; +my $upd_running; ######################################## @@ -69,14 +70,18 @@ CommandUpdate($$) $updateInBackground = AttrVal("global","updateInBackground",1); $updateInBackground = 0 if($arg ne "all"); $updArg = $arg; + return "An update is already running" if($upd_running); + $upd_running = 1; if($updateInBackground) { 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."; } else { doUpdateLoop($src, $arg); my $ret = $updRet; $updRet = ""; + $upd_running = 0; return $ret; }