From 16ce982fa6a2de8af1eeceec0ba69424370ba442 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Oct 2023 14:21:53 +0200 Subject: [PATCH] system: keep polling if watcher cannot load a class This happened two times now... [09-Oct-2023 19:25:44 Europe/Berlin] PHP Fatal error: Uncaught Error: Class "OPNsense\Base\ModelException" not found in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php:314 Stack trace: thrown in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php on line 314 --- src/opnsense/scripts/routes/gateway_watcher.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/opnsense/scripts/routes/gateway_watcher.php b/src/opnsense/scripts/routes/gateway_watcher.php index 3d3fef5d4..54ea5202c 100755 --- a/src/opnsense/scripts/routes/gateway_watcher.php +++ b/src/opnsense/scripts/routes/gateway_watcher.php @@ -57,7 +57,13 @@ sleep($wait); while (1) { pcntl_signal_dispatch(); - $status = dpinger_status(); + try { + $status = dpinger_status(); + } catch (Exception $e) { + sleep($poll); + continue; + } + $alarm = false; /* clear known gateways in first step to flush unknown in second step */