mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
PRESENCE: rescheduling new check if fork fails (by frank, Forum: #40119)
git-svn-id: https://svn.fhem.de/fhem/trunk@9111 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ede8ea993d
commit
ada2b5038f
@ -550,6 +550,18 @@ sub PRESENCE_StartLocalScan($;$)
|
|||||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalFunctionScan", $name."|".$hash->{helper}{call}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalFunctionScan", $name."|".$hash->{helper}{call}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$hash->{helper}{RUNNING_PID})
|
||||||
|
{
|
||||||
|
delete($hash->{helper}{RUNNING_PID});
|
||||||
|
|
||||||
|
my $seconds = (ReadingsVal($name, "state", "absent") eq "present" ? $hash->{TIMEOUT_PRESENT} : $hash->{TIMEOUT_NORMAL});
|
||||||
|
|
||||||
|
Log3 $hash->{NAME}, 4, "PRESENCE ($name) - fork failed, rescheduling next check in $seconds seconds";
|
||||||
|
|
||||||
|
RemoveInternalTimer($hash);
|
||||||
|
InternalTimer(gettimeofday()+$seconds, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
||||||
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user