Commit b94f9af2 authored by Dries's avatar Dries

- Patch #12455 by Steven: optimized SQL query.  This problem caused Drupal.org's
  cron runs to time out.
parent 95595ae6
......@@ -487,7 +487,7 @@ function statistics_cron() {
}
/* clean expired access logs */
db_query('DELETE FROM {accesslog} WHERE '. time() .' - timestamp > '. variable_get('statistics_flush_accesslog_timer', 259200));
db_query('DELETE FROM {accesslog} WHERE timestamp < %d', time() - variable_get('statistics_flush_accesslog_timer', 259200));
}
/**
......
......@@ -487,7 +487,7 @@ function statistics_cron() {
}
/* clean expired access logs */
db_query('DELETE FROM {accesslog} WHERE '. time() .' - timestamp > '. variable_get('statistics_flush_accesslog_timer', 259200));
db_query('DELETE FROM {accesslog} WHERE timestamp < %d', time() - variable_get('statistics_flush_accesslog_timer', 259200));
}
/**
......
......@@ -74,7 +74,7 @@ function watchdog_perm() {
* Remove expired log messages.
*/
function watchdog_cron() {
db_query('DELETE FROM {watchdog} WHERE '. time() .' - timestamp > '. variable_get('watchdog_clear', 604800));
db_query('DELETE FROM {watchdog} WHERE timestamp < %d', time() - variable_get('watchdog_clear', 604800));
}
/**
......
......@@ -74,7 +74,7 @@ function watchdog_perm() {
* Remove expired log messages.
*/
function watchdog_cron() {
db_query('DELETE FROM {watchdog} WHERE '. time() .' - timestamp > '. variable_get('watchdog_clear', 604800));
db_query('DELETE FROM {watchdog} WHERE timestamp < %d', time() - variable_get('watchdog_clear', 604800));
}
/**
......
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