Skip to content

Commit

Permalink
cleaning used function
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Jul 15, 2024
1 parent b860918 commit aec6eaa
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
1 change: 0 additions & 1 deletion core/ajax/user.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@
$_SESSION['user']->setLogin($login);
$_SESSION['user']->save();
@session_write_close();
eqLogic::clearCacheWidget();
ajax::success();
}

Expand Down
5 changes: 0 additions & 5 deletions core/class/cmd.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1125,9 +1125,6 @@ public function remove() {
viewData::removeByTypeLinkId('cmd', $this->getId());
dataStore::removeByTypeLinkId('cmd', $this->getId());
$eqLogic = $this->getEqLogic();
if (is_object($eqLogic)) {
$eqLogic->emptyCacheWidget();
}
$this->emptyHistory();
cache::delete('cmdCacheAttr' . $this->getId());
cache::delete('cmd' . $this->getId());
Expand Down Expand Up @@ -1887,7 +1884,6 @@ public function event($_value, $_datetime = null, $_loop = 1) {
}
if ($repeat && $this->getConfiguration('repeatEventManagement', 'never') == 'never') {
$this->addHistoryValue($value, $this->getCollectDate());
$eqLogic->emptyCacheWidget();
event::adds('cmd::update', array(array('cmd_id' => $this->getId(), 'value' => $value, 'display_value' => $display_value, 'unit' => $unit, 'raw_unit' => $raw_unit, 'valueDate' => $this->getValueDate(), 'collectDate' => $this->getCollectDate())));
return;
}
Expand Down Expand Up @@ -1936,7 +1932,6 @@ public function event($_value, $_datetime = null, $_loop = 1) {
}
$this->addHistoryValue($value, $this->getCollectDate());
$this->checkReturnState($value);
$eqLogic->emptyCacheWidget();
if (!$repeat) {
$this->checkCmdAlert($value);
if (isset($level) && $level != $this->getCache('alertLevel')) {
Expand Down
8 changes: 1 addition & 7 deletions core/class/scenario.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1021,10 +1021,7 @@ public function toHtml($_version) {
*
*/
public function emptyCacheWidget() {
$mc = cache::byKey('scenarioHtmldashboard' . $this->getId());
$mc->remove();
$mc = cache::byKey('scenarioHtmlmobile' . $this->getId());
$mc->remove();

}
/**
*
Expand Down Expand Up @@ -1100,7 +1097,6 @@ public function save() {
$this->setLastLaunch($calculateScheduleDate['prevDate']);
}
DB::save($this);
$this->emptyCacheWidget();
if ($this->_changeState) {
$this->_changeState = false;
event::add('scenario::update', array('scenario_id' => $this->getId(), 'isActive' => $this->getIsActive(), 'state' => $this->getState(), 'lastLaunch' => $this->getLastLaunch(), 'name' => $this->getName(), 'icon' => $this->getIcon()));
Expand All @@ -1118,7 +1114,6 @@ public function remove() {
foreach (($this->getElement()) as $element) {
$element->remove();
}
$this->emptyCacheWidget();
if (file_exists(__DIR__ . '/../../log/scenarioLog/scenario' . $this->getId() . '.log')) {
unlink(__DIR__ . '/../../log/scenarioLog/scenario' . $this->getId() . '.log');
}
Expand Down Expand Up @@ -1727,7 +1722,6 @@ public function setGroup($_group) {
*/
public function setState($state) {
if ($this->getCache('state') != $state) {
$this->emptyCacheWidget();
event::add('scenario::update', array('scenario_id' => $this->getId(), 'state' => $state, 'lastLaunch' => $this->getLastLaunch()));
}
$this->setCache('state', $state);
Expand Down
12 changes: 0 additions & 12 deletions core/class/widgets.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,6 @@ public function save() {
return true;
}

public function postSave(){
$usedBy = $this->getUsedBy();
if(is_array($usedBy) && count($usedBy) > 0){
foreach ($usedBy as $cmd) {
$eqLogic = $cmd->getEqLogic();
if(is_object($eqLogic)){
$eqLogic->emptyCacheWidget();
}
}
}
}

public function remove() {
$usedBy = $this->getUsedBy();
if(is_array($usedBy) && count($usedBy) > 0){
Expand Down

0 comments on commit aec6eaa

Please sign in to comment.