From 31593b1e6fa71631ebce2cd2cda41ef0b4656c66 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 7 Sep 2023 09:36:04 +0200 Subject: [PATCH] system: small refactor for clarity --- src/opnsense/scripts/routes/gateway_watcher.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/opnsense/scripts/routes/gateway_watcher.php b/src/opnsense/scripts/routes/gateway_watcher.php index 52d78f5af..3d3fef5d4 100755 --- a/src/opnsense/scripts/routes/gateway_watcher.php +++ b/src/opnsense/scripts/routes/gateway_watcher.php @@ -141,14 +141,9 @@ while (1) { } } - /* react to alarm if backend action was given */ - if ($alarm) { - if ($action != null) { - configd_run($action); - } - /* XXX this blacks out all alarms for the grace period after alarm */ - sleep($wait); - } else { - sleep($poll); + if ($alarm && $action != null) { + configd_run($action); } + + sleep($alarm ? $wait : $poll); }