mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
cronjobs/cleaner.php removed shopimport_amazon_fees
This commit is contained in:
parent
d180a1af54
commit
94f3fb0261
@ -148,8 +148,7 @@ $tables = [
|
|||||||
'templatemessage',
|
'templatemessage',
|
||||||
'shopimport_auftraege',
|
'shopimport_auftraege',
|
||||||
'versandzentrum_log',
|
'versandzentrum_log',
|
||||||
'api_request_response_log',
|
'api_request_response_log'
|
||||||
'shopimport_amazon_fees',
|
|
||||||
];
|
];
|
||||||
$minMemoryMb = 1;
|
$minMemoryMb = 1;
|
||||||
$minMemory = $minMemoryMb * 1024 * 1024;
|
$minMemory = $minMemoryMb * 1024 * 1024;
|
||||||
@ -623,34 +622,11 @@ if($shopExportLogCleanerActive && $tage > 0) {
|
|||||||
|
|
||||||
$shopExportLogCleanerActive = $app->erp->Firmendaten('cleaner_shopexportlog');
|
$shopExportLogCleanerActive = $app->erp->Firmendaten('cleaner_shopexportlog');
|
||||||
$tage = (int)$app->erp->Firmendaten('cleaner_shopexportlog_tage');
|
$tage = (int)$app->erp->Firmendaten('cleaner_shopexportlog_tage');
|
||||||
$isToDelete = !empty($tableSchemaByTables['shopimport_amazon_fees'])
|
|
||||||
&& !empty($tableSchemaByTables['shopimport_amazon_fees']['todelete']);
|
|
||||||
if((!$shopExportLogCleanerActive || $tage <= 0 || $tage > 30) && $isToDelete) {
|
|
||||||
$shopExportLogCleanerActive = true;
|
|
||||||
if($tage <= 0 || $tage > 30) {
|
|
||||||
$tage = 30;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($shopExportLogCleanerActive && $tage > 0) {
|
if($shopExportLogCleanerActive && $tage > 0) {
|
||||||
if($tage < 30) {
|
if($tage < 30) {
|
||||||
$tage = 30;
|
$tage = 30;
|
||||||
}
|
}
|
||||||
$app->DB->Delete(
|
|
||||||
sprintf(
|
|
||||||
"DELETE FROM `shopimport_amazon_fees`
|
|
||||||
WHERE DATE_SUB(NOW(), INTERVAL %d DAY) >= `zeitstempel` OR `zeitstempel` = '0000-00-00 00:00:00'",
|
|
||||||
$tage
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$affectedRows = $app->DB->affected_rows();
|
|
||||||
if(!empty($tableSchemaByTables['shopimport_amazon_fees'])
|
|
||||||
&& ($tableSchemaByTables['shopimport_amazon_fees']['todelete'] > 0)) {
|
|
||||||
$tableSchemaByTables['shopimport_amazon_fees']['todelete'] -= $affectedRows;
|
|
||||||
}
|
|
||||||
if($affectedRows > 0 && !empty($optimize['shopimport_amazon_fees'])) {
|
|
||||||
$app->DB->Query('OPTIMIZE TABLE `shopimport_amazon_fees`');
|
|
||||||
unset($optimize['shopimport_amazon_fees']);
|
|
||||||
}
|
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE prozessstarter SET letzteausfuerhung=NOW(),mutex=1,mutexcounter=0 WHERE parameter = 'cleaner' AND aktiv = 1"
|
"UPDATE prozessstarter SET letzteausfuerhung=NOW(),mutex=1,mutexcounter=0 WHERE parameter = 'cleaner' AND aktiv = 1"
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user