- Patch #12455 by Steven: optimized SQL query. This problem caused Drupal.org's

cron runs to time out.
4.6.x
Dries Buytaert 2004-11-02 15:09:09 +00:00
parent 95595ae6f8
commit b94f9af24f
4 changed files with 4 additions and 4 deletions

View File

@ -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));
}
/**

View File

@ -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));
}
/**

View File

@ -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));
}
/**

View File

@ -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));
}
/**