You are here

function dblog_cron in Drupal 6

Same name and namespace in other branches
  1. 8 core/modules/dblog/dblog.module \dblog_cron()
  2. 7 modules/dblog/dblog.module \dblog_cron()
  3. 9 core/modules/dblog/dblog.module \dblog_cron()
  4. 10 core/modules/dblog/dblog.module \dblog_cron()

Implementation of hook_cron().

Remove expired log messages.

File

modules/dblog/dblog.module, line 102
System monitoring and logging for administrators.

Code

function dblog_cron() {

  // Cleanup the watchdog table
  $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));
}