Commit 55cc4399 authored by Dries's avatar Dries

- Patch #178044 by chx: properly delete watchdog messages captured by the dblog.module.

parent 1deae850
......@@ -97,15 +97,8 @@ function dblog_init() {
*/
function dblog_cron() {
// Cleanup the watchdog table
$min = db_result(db_query('SELECT MIN(wid) FROM {watchdog}'));
if ($min) {
$max = db_result(db_query('SELECT MAX(wid) FROM {watchdog}'));
if ($max) {
if (($max - $min) > variable_get('dblog_row_limit', 1000)) {
db_query('DELETE FROM {watchdog} WHERE wid < %d', $max - $min);
}
}
}
$max = db_result(db_query('SELECT MAX(wid) FROM {watchdog}'));
db_query('DELETE FROM {watchdog} WHERE wid < %d', $max - variable_get('dblog_row_limit', 1000));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment