Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Oct 23, 2024
1 parent 9a38b0e commit b568493
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 1 addition & 14 deletions install/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,7 @@
$backup_ok = true;
}
echo "[PROGRESS][10]\n";
try {
echo "Save cache state of cmd and eqLogic...";
$data = array('cmd' => array(),'eqLogic' => array());
foreach(cmd::all() as $cmd){
$data['cmd'][$cmd->getId()] = $cmd->getCache();
}
foreach(eqLogic::all() as $eqLogic){
$data['eqLogic'][$eqLogic->getId()] = $eqLogic->getCache();
}
file_put_contents('/tmp/jeedom/cache.json',json_encode($data));
echo "OK\n";
} catch (Exception $e) {
echo '***WARNING***' . $e->getMessage();
}

echo "[PROGRESS][12]\n";

if (init('core', 1) == 1) {
Expand Down
15 changes: 14 additions & 1 deletion install/update/4.5.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,18 @@
} catch (\Throwable $th) {
echo 'Error on empty cache : '.$th->getMessage();
}

try {
echo "Save cache state of cmd and eqLogic...";
$data = array('cmd' => array(),'eqLogic' => array());
foreach(cmd::all() as $cmd){
$data['cmd'][$cmd->getId()] = $cmd->getCache();
}
foreach(eqLogic::all() as $eqLogic){
$data['eqLogic'][$eqLogic->getId()] = $eqLogic->getCache();
}
file_put_contents('/tmp/jeedom/cache.json',json_encode($data));
echo "OK\n";
} catch (Exception $e) {
echo '***WARNING***' . $e->getMessage();
}
echo shell_exec('php '.__DIR__.'/reloadCache.php');

0 comments on commit b568493

Please sign in to comment.