|
|
@@ -1588,7 +1588,7 @@ SQL;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static function reloadCache_updateAll($full, $onlyBase) {
|
|
|
+ private function reloadCache_updateAll($full, $onlyBase) {
|
|
|
$tablesConf = [
|
|
|
'BI_audit_CEIDG' => [
|
|
|
'fields' => [
|
|
|
@@ -1837,8 +1837,7 @@ SQL;
|
|
|
foreach ($extraRefTablesConf as $refTableFrom => $refTableConf) {
|
|
|
foreach ($refTableConf['refTablesTo'] as $refTableTo) {
|
|
|
if ($refTable = $this->refTables->getRefTable($refTableFrom, $refTableTo)) {
|
|
|
- $queries[] = "truncate table `{$refTable}`"; // TODO do wywalenia po pierwszym wyzwoleniu
|
|
|
- //$queries[] = "delete from `{$refTable}` where `TRANSACTION_ID` = '-1'"; // TODO do odhashowania po pierwszym wyzwoleniu
|
|
|
+ $queries[] = "delete from `{$refTable}` where `TRANSACTION_ID` = '-1'";
|
|
|
$queries[] = "insert into `{$refTable}` (`PRIMARY_KEY`, `REMOTE_PRIMARY_KEY`, `TRANSACTION_ID`, `A_STATUS`) select `all1`.`ID`, `all2`.`ID`, '-1', 'NORMAL' from `BI_audit_ALL` as `all1` join `BI_audit_ALL_ref` as `ref` on `all1`.`ID` = `ref`.`ID1` join `BI_audit_ALL` as `all2` on `ref`.`ID2` = `all2`.`ID` where `all1`.`REMOTE_TABLE` = '{$refTableFrom}' and `all2`.`REMOTE_TABLE` = '{$refTableTo}'";
|
|
|
}
|
|
|
}
|
|
|
@@ -1895,7 +1894,7 @@ SQL;
|
|
|
// DB::getPDO()->query("unlock tables");
|
|
|
}
|
|
|
|
|
|
- public static function doReloadCache($full = false) {
|
|
|
+ public function doReloadCache($full = false) {
|
|
|
if ($full === 'base') {
|
|
|
$onlyBase = true;
|
|
|
$full = false;
|
|
|
@@ -1914,8 +1913,8 @@ SQL;
|
|
|
self::reloadCache_reTeryt($full);
|
|
|
error_log('now: self::reloadCache_parseUmowy');
|
|
|
self::reloadCache_parseUmowy($full);
|
|
|
- error_log('now: self::reloadCache_parseUmowy');
|
|
|
- self::reloadCache_updateAll($full, $onlyBase);
|
|
|
+ error_log('now: $this->reloadCache_updateAll');
|
|
|
+ $this->reloadCache_updateAll($full, $onlyBase);
|
|
|
if ($full) file_put_contents($reloadCacheResultFile, "ok");
|
|
|
} catch (Exception $e) {
|
|
|
var_dump($e);
|
|
|
@@ -1963,7 +1962,7 @@ SQL;
|
|
|
} while ($activeReloadingCache);
|
|
|
|
|
|
BiAuditPowiazania::saveToLog("Uruchamiam częściowe odświeżenie cache");
|
|
|
- self::doReloadCache();
|
|
|
+ $this->doReloadCache();
|
|
|
BiAuditPowiazania::saveToLog("Odświeżono częściowo cache");
|
|
|
|
|
|
$sqlArr = [
|