mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-04-11 12:50:55 +00:00
Added a check for the existence of logs folder. Do not report about abandoned carts state in logs
This commit is contained in:
parent
49f687f6ff
commit
5fc6e4c5b8
2 changed files with 13 additions and 4 deletions
|
@ -210,9 +210,14 @@ class RetailcrmLogger
|
|||
public static function clearObsoleteLogs()
|
||||
{
|
||||
$logDir = self::getLogDir();
|
||||
|
||||
if (!is_dir($logDir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$handle = opendir($logDir);
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (false !== self::checkFileName($file)) {
|
||||
if (self::checkFileName($file) !== false) {
|
||||
$path = "$logDir/$file";
|
||||
if (filemtime($path) < strtotime('-30 days')) {
|
||||
unlink($path);
|
||||
|
@ -226,9 +231,13 @@ class RetailcrmLogger
|
|||
$fileNames = [];
|
||||
$logDir = self::getLogDir();
|
||||
|
||||
if (!is_dir($logDir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$handle = opendir($logDir);
|
||||
while (false !== $file = readdir($handle)) {
|
||||
if (false !== self::checkFileName($file)) {
|
||||
while ($file = readdir($handle) !== false) {
|
||||
if (self::checkFileName($file) !== false) {
|
||||
$path = "$logDir/$file";
|
||||
$fileNames[] = [
|
||||
'name' => $file,
|
||||
|
|
|
@ -63,7 +63,7 @@ class RetailcrmAbandonedCartsEvent extends RetailcrmAbstractEvent implements Ret
|
|||
$syncCartsActive = Configuration::get(RetailCRM::SYNC_CARTS_ACTIVE);
|
||||
|
||||
if (empty($syncCartsActive)) {
|
||||
RetailcrmLogger::writeCaller(__METHOD__, 'Abandoned carts is disabled, skipping...');
|
||||
RetailcrmLogger::writeDebug(__METHOD__, 'Abandoned carts is disabled, skipping...');
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue