I've updated to 6.x-2.x-dev. I am running the following script (via drush) to simulate millennium_cron running over and over and over until it rolls over.

module_load_include('inc', 'millennium', 'millennium.cron');
set_time_limit(0);
$current_record = variable_get('millennium_webopac_current_itemrecord',1000000);
$start_record = variable_get('millennium_webopac_start_itemrecord', 10000);
while($current_record >= $start_record) {
  millennium_cron_do(); 
  $current_record = variable_get('millennium_webopac_current_itemrecord',1000000);
  dd("--$current_record");
  millennium_exit();
}

Unfortunately, at 500 records per cron run I can't get it to rollover. It just keeps auto-adjusting the max item record ("millennium_webopac_end_itemrecord") infinitely, even after it's definitely stopped finding records.

I think the issue might be at lines 216-220:

    // Adjust ending record if records are being found past that number
    if ($current_rec_num > $default_end) {
      millennium_variable_set('millennium_webopac_end_itemrecord', $current_rec_num);
      $default_end = $current_rec_num;
    }

If I adjust the code as below, I get the behavior that I would expect.

    // Adjust ending record if records are being found past that number
    if ($last_succesful_rec_num > $default_end) {
      millennium_variable_set('millennium_webopac_end_itemrecord', $last_succesful_rec_num);
      $default_end = $last_succesful_rec_num;
    }

It's completely possible that I'm missing something....

CommentFileSizeAuthor
#1 millennium-cron-1344742.patch648 bytesjanusman

Comments

janusman’s picture

Assigned: Unassigned » janusman
Status: Active » Needs review
StatusFileSize
new648 bytes

Yes, you found a real problem =)

I'll run some tests too, but I think that will pretty much fix it.

This is the above in patch form.

Status: Needs review » Needs work

The last submitted patch, millennium-cron-1344742.patch, failed testing.

janusman’s picture

Status: Needs work » Needs review

Nevermind the bot, it's weirding out =)

I'll set back to needs review.

janusman’s picture

Status: Needs review » Closed (fixed)

Fixed in 7.x and 6.x branches. Thanks!!!