diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-08 06:36:34 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-08 06:36:34 +0000 |
commit | 0dd161277046bab1ec994e8d756c4e99c717421e (patch) | |
tree | 5f33a4f472b6b5e10544924e5bf6cfc0348b8d08 /modules/system/system.module | |
parent | e07b9d35a1f4dcb1678c4d3bb6482daaebea6350 (diff) | |
download | brdo-0dd161277046bab1ec994e8d756c4e99c717421e.tar.gz brdo-0dd161277046bab1ec994e8d756c4e99c717421e.tar.bz2 |
#629794 by yched: Fix Scaling issues with batch API. (with tests)
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index e0da1720b..6247fcb2f 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2695,10 +2695,6 @@ function system_cron() { db_delete('flood') ->condition('expiration', REQUEST_TIME, '<') ->execute(); - // Cleanup the batch table. - db_delete('batch') - ->condition('timestamp', REQUEST_TIME - 864000, '<') - ->execute(); // Remove temporary files that are older than DRUPAL_MAXIMUM_TEMP_FILE_AGE. // Use separate placeholders for the status to avoid a bug in some versions @@ -2722,6 +2718,15 @@ function system_cron() { cache_clear_all(NULL, $table); } + // Cleanup the batch table and the queue for failed batches. + db_delete('batch') + ->condition('timestamp', REQUEST_TIME - 864000, '<') + ->execute(); + db_delete('queue') + ->condition('created', REQUEST_TIME - 864000, '<') + ->condition('name', 'drupal_batch:%', 'LIKE') + ->execute(); + // Reset expired items in the default queue implementation table. If that's // not used, this will simply be a no-op. db_update('queue') |