diff --git a/modules/qlogooglehotelconnector/classes/QghcApiLog.php b/modules/qlogooglehotelconnector/classes/QghcApiLog.php index 4c1a6c072..a4641420d 100644 --- a/modules/qlogooglehotelconnector/classes/QghcApiLog.php +++ b/modules/qlogooglehotelconnector/classes/QghcApiLog.php @@ -101,7 +101,6 @@ class QghcApiLog extends ObjectModel if (!Db::getInstance()->delete('qghc_api_log', '`date_add` < \'' . pSQL($cutoff) . '\'')) { return false; } - $count = (int) Db::getInstance()->Affected_Rows(); // Daily file logs follow the same retention window as the DB rows. $logDir = _PS_MODULE_DIR_ . 'qlogooglehotelconnector/logs/'; @@ -114,6 +113,6 @@ class QghcApiLog extends ObjectModel } } - return array('count' => $count, 'cutoff' => $cutoff); + return true; } } diff --git a/modules/qlogooglehotelconnector/ghclogcron.php b/modules/qlogooglehotelconnector/ghclogcron.php index 87269090a..a00912974 100644 --- a/modules/qlogooglehotelconnector/ghclogcron.php +++ b/modules/qlogooglehotelconnector/ghclogcron.php @@ -38,10 +38,8 @@ if ($token !== Tools::encrypt('qlogooglehotelconnector')) { // Delete qghc_api_log rows and daily file logs older than 2 months Module::getInstanceByName('qlogooglehotelconnector'); // loads the module classes -$result = QghcApiLog::cleanupApiLogs(); - -if ($result !== false) { - echo 'OK — ' . (int)$result['count'] . ' log(s) deleted (older than ' . $result['cutoff'] . ').'; +if (QghcApiLog::cleanupApiLogs()) { + echo 'OK — logs older than 2 months deleted.'; } else { header('HTTP/1.1 500 Internal Server Error'); echo 'ERROR — failed to delete old logs.';