- Patch #12455 by Steven: optimized SQL query. This problem caused Drupal.org's
cron runs to time out.4.6.x
parent
95595ae6f8
commit
b94f9af24f
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue