From e6794d265aed1a5b59e079ae858a531586d5da8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:36:25 +0100 Subject: [PATCH 1/2] Random network check --- core/class/jeedom.class.php | 7 ------- docs/fr_FR/changelog.md | 1 + install/consistency.php | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/core/class/jeedom.class.php b/core/class/jeedom.class.php index e72a0573ee..d090860d81 100644 --- a/core/class/jeedom.class.php +++ b/core/class/jeedom.class.php @@ -1078,13 +1078,6 @@ public static function cron5() { } public static function cron10() { - try { - network::cron10(); - } catch (Exception $e) { - log::add('network', 'error', 'network::cron : ' . log::exception($e)); - } catch (Error $e) { - log::add('network', 'error', 'network::cron : ' . log::exception($e)); - } try { foreach ((update::listRepo()) as $name => $repo) { $class = 'repo_' . $name; diff --git a/docs/fr_FR/changelog.md b/docs/fr_FR/changelog.md index 98c2208add..d1ee56ea38 100644 --- a/docs/fr_FR/changelog.md +++ b/docs/fr_FR/changelog.md @@ -84,6 +84,7 @@ - Ajout d'un bouton de mise à jour sur la ligne "core" en plus de celui en haut à droite [LIEN](https://github.com/jeedom/core/pull/2974) - Correction de l'écran "package" au niveau des packages python2 [LIEN](https://github.com/jeedom/core/pull/2973) - Correction d'un bug lors de la mise à jour des équipements sur la page de batterie [LIEN](https://github.com/jeedom/core/pull/3008) +- La verification de la connexion réseaux est maintenant aléatoire toute les 10min pour eviter des soucis de reconnexion de toute les box Jeedom en meme temps lors de micro coupure >**IMPORTANT** > diff --git a/install/consistency.php b/install/consistency.php index 290a9f728a..abf3e17ff6 100644 --- a/install/consistency.php +++ b/install/consistency.php @@ -379,6 +379,25 @@ $cron->setTimeout(10); $cron->save(); + $cron = cron::byClassAndFunction('network', 'cron10'); + if (!is_object($cron)) { + echo "Create network::cron10\n"; + $cron = new cron(); + $cron->setClass('network'); + $cron->setFunction('cron10'); + $rand_min = rand(0,9); + $cron = ''; + for($i=0;$i<6;$i++){ + $cron .= ($rand_min+($i*10)).','; + } + $cron = trim($cron,',').' * * * *'; + $cron->setSchedule($cron); + $cron->setEnable(1); + $cron->setDeamon(0); + $cron->setTimeout(60); + $cron->save(); + } + if (!file_exists(__DIR__ . '/../plugins')) { mkdir(__DIR__ . '/../plugins'); } From 3228cbb3a5d964a865dee8026107a4fd1f6f7cee Mon Sep 17 00:00:00 2001 From: "Johan .V" Date: Fri, 31 Jan 2025 14:51:55 +0100 Subject: [PATCH 2/2] Reformulation --- docs/fr_FR/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fr_FR/changelog.md b/docs/fr_FR/changelog.md index d1ee56ea38..01412381fa 100644 --- a/docs/fr_FR/changelog.md +++ b/docs/fr_FR/changelog.md @@ -84,7 +84,7 @@ - Ajout d'un bouton de mise à jour sur la ligne "core" en plus de celui en haut à droite [LIEN](https://github.com/jeedom/core/pull/2974) - Correction de l'écran "package" au niveau des packages python2 [LIEN](https://github.com/jeedom/core/pull/2973) - Correction d'un bug lors de la mise à jour des équipements sur la page de batterie [LIEN](https://github.com/jeedom/core/pull/3008) -- La verification de la connexion réseaux est maintenant aléatoire toute les 10min pour eviter des soucis de reconnexion de toute les box Jeedom en meme temps lors de micro coupure +- La vérification de la connexion réseau est désormais effectuée de manière aléatoire toutes les 10 minutes afin d'éviter que toutes les box Jeedom ne tentent de se reconnecter simultanément en cas de microcoupure. >**IMPORTANT** >