Revise timeout defaults

This commit is contained in:
Mr-Dave
2024-09-04 11:09:23 -06:00
parent 1678783d06
commit e3b63c8797
4 changed files with 18 additions and 14 deletions

View File

@@ -824,17 +824,21 @@
<h3><a name="watchdog_tmo"></a>watchdog_tmo</h3>
<ul>
<li> Values: Integer | Default: 30 </li>
<li> Values: Integer | Default: 90 </li>
Number of seconds that elapse before a camera is deemed to be unresponsive and MotionPlus triggers
a watchdog timeout and begins to force the camera to shut down.
a watchdog timeout and begins to force the camera to shut down. When camera is initially starting, the
timeout is set to three(3) times this value.
</ul>
<p></p>
<h3><a name="watchdog_kill"></a>watchdog_kill</h3>
<ul>
<li> Values: Integer | Default: 10 </li>
Number of seconds that elapse after the watchdog_tmo that MotionPlus waits until the
kill processes begin to force the camera to shut down.
<li> Values: Integer | Default: 0 </li>
Specifying a value of zero indicates that Motionplus will completely terminate after the watchdog_tmo.
Values greater than zero represent the number of additional seconds after the watchdog_tmo MotionPlus will wait
until camera processes are forcefully terminated. Forceful termination of camera processes will result in memory
leaks and detrimental effects therefore the default is to completely terminate the application let external processes
such as systemctl or cron jobs restart Motionplus.
</ul>
<p></p>
@@ -1299,9 +1303,9 @@
<div>
<i><h4>interrupt</h4></i>
The duration in seconds permitted for reading an image from the netcam source. For the initial connection
The duration in seconds permitted for the library functions to respond. For the initial connection
to the camera, the maximum duration is set equal to three times the interrupt specified. The default
number of seconds is 20.
is 90 seconds.
</div>
<p></p>

View File

@@ -729,7 +729,7 @@ void cls_config::edit_watchdog_tmo(std::string &parm, enum PARM_ACT pact)
{
int parm_in;
if (pact == PARM_ACT_DFLT) {
watchdog_tmo = 30;
watchdog_tmo = 90;
} else if (pact == PARM_ACT_SET) {
parm_in = atoi(parm.c_str());
if (parm_in < 1) {

View File

@@ -833,7 +833,7 @@ cls_libcam::cls_libcam(cls_camera *p_cam)
MOTPLS_LOG(NTC, TYPE_VIDEO, NO_ERRNO,_("Opening libcam"));
cam = p_cam;
params = nullptr;
cam->watchdog = cam->cfg->watchdog_tmo;
cam->watchdog = cam->cfg->watchdog_tmo * 3; /* 3 is arbitrary multiplier to give startup more time*/
if (libcam_start() < 0) {
MOTPLS_LOG(ERR, TYPE_VIDEO, NO_ERRNO,_("libcam failed to open"));
libcam_stop();

View File

@@ -1689,7 +1689,7 @@ void cls_netcam::set_parms ()
filenbr = 0;
filelist.clear();
filedir = "";
cfg_idur = 20;
cfg_idur = 90;
for (it = params->params_array.begin();
it != params->params_array.end(); it++) {
@@ -2266,7 +2266,7 @@ cls_netcam::cls_netcam(cls_camera *p_cam, bool p_is_high)
} else {
MOTPLS_LOG(NTC, TYPE_VIDEO, NO_ERRNO,_("High: Opening Netcam"));
}
cam->watchdog = cam->cfg->watchdog_tmo * 3; /* 3 is arbitrary multiplier to give startup more time*/
set_parms();
if (service == "file") {
retcd = connect();
@@ -2285,14 +2285,14 @@ cls_netcam::cls_netcam(cls_camera *p_cam, bool p_is_high)
return;
}
}
cam->watchdog = cam->cfg->watchdog_tmo;
cam->watchdog = cam->cfg->watchdog_tmo * 3; /* 3 is arbitrary multiplier to give startup more time*/
if (read_image() != 0) {
MOTPLS_LOG(NTC, TYPE_NETCAM, NO_ERRNO
,_("Failed trying to read first image"));
handler_shutdown();
return;
}
cam->watchdog = cam->cfg->watchdog_tmo;
cam->watchdog = cam->cfg->watchdog_tmo * 3; /* 3 is arbitrary multiplier to give startup more time*/
/* When running dual, there seems to be contamination across norm/high with codec functions. */
context_close(); /* Close in this thread to open it again within handler thread */
status = NETCAM_RECONNECTING; /* Set as reconnecting to avoid excess messages when starting */
@@ -2302,7 +2302,7 @@ cls_netcam::cls_netcam(cls_camera *p_cam, bool p_is_high)
cam->imgs.width_high = imgsize.width;
cam->imgs.height_high = imgsize.height;
}
cam->watchdog = cam->cfg->watchdog_tmo;
cam->watchdog = cam->cfg->watchdog_tmo * 3; /* 3 is arbitrary multiplier to give startup more time*/
handler_startup();
cam->device_status = STATUS_OPENED;