Index: uc_recurring.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_recurring/uc_recurring.module,v
retrieving revision 1.1.4.91
diff -u -p -r1.1.4.91 uc_recurring.module
--- uc_recurring.module	13 Jan 2011 04:10:26 -0000	1.1.4.91
+++ uc_recurring.module	6 Feb 2011 12:49:08 -0000
@@ -233,11 +233,13 @@ function uc_recurring_recurring_info() {
  * to requests).
  */
 function uc_recurring_cron() {
-  $fail = $success = 0;
+  $start = time();
+  lock_acquire('uc_recurring_cron', 30);
 
   if (variable_get('uc_recurring_trigger_renewals', TRUE)) {
     $fees = uc_recurring_get_fees_for_renew();
     if (!empty($fees)) {
+      $fail = $success = 0;
       foreach ($fees as $fee) {
         if ($order_id = uc_recurring_renew($fee)) {
           $success++;
@@ -246,10 +248,14 @@ function uc_recurring_cron() {
           // payment attempted but failed
           $fail++;
         }
+        if ($start - time() > 1800) { // 30seconds
+          break;
+        }
       }
       watchdog('uc_recurring', '@success recurring fees processed successfully; @fail failed.', array('@success' => $success, '@fail' => $fail));
     }
   }
+  lock_release('uc_recurring_cron');
 
   $fees = uc_recurring_get_fees_for_expiration();
   if (!empty($fees)) {
