- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/event_log.php
- Класс: CEventLog
- Вызов: CEventLog::CleanUpAgent
static function CleanUpAgent()
{
global $DB;
$cleanup_days = COption::GetOptionInt("main", "event_log_cleanup_days", 7);
if($cleanup_days > 0)
{
$arDate = localtime(time());
$date = mktime(0, 0, 0, $arDate[4]+1, $arDate[3]-$cleanup_days, 1900+$arDate[5]);
$DB->Query("DELETE FROM b_event_log WHERE TIMESTAMP_X <= ".$DB->CharToDateFunction(ConvertTimeStamp($date, "FULL")));
}
return "CEventLog::CleanUpAgent();";
}