Skip to content

Commit

Permalink
Random network check
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Jan 31, 2025
1 parent 61c6ce2 commit e6794d2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
7 changes: 0 additions & 7 deletions core/class/jeedom.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
>
Expand Down
19 changes: 19 additions & 0 deletions install/consistency.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit e6794d2

Please sign in to comment.