Skip to content
Snippets Groups Projects
Commit 55cc4399 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

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

parent 1deae850
No related branches found
No related tags found
No related merge requests found
......@@ -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));
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment