Changeset 1343

Show
Ignore:
Timestamp:
01/29/08 21:22:23 (6 months ago)
Author:
mpaschal
Message:

Process jobs one and a time, instead of trying to yank them all
(We're only coalescing them to get hotter caches, I guess, anyway)
BugzID: 65407

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-29/lib/MT/Worker/Publish.pm

    r1174 r1343  
    2424    # and process them in one pass. 
    2525 
    26     my @jobs
    27     push @jobs, $job
     26    my @jobs = ($job)
     27    my $job_iter
    2828    if (my $key = $job->coalesce) { 
    29         while (my $job = MT::TheSchwartz->instance->find_job_with_coalescing_value($class, $key)) { 
    30             push @jobs, $job; 
    31         } 
     29        $job_iter = sub { 
     30            shift @jobs || MT::TheSchwartz->instance->find_job_with_coalescing_value($class, $key); 
     31        }; 
     32    } 
     33    else { 
     34        $job_iter = sub { shift @jobs }; 
    3235    } 
    3336 
     
    4043    my $rebuilt = 0; 
    4144 
    42     foreach $job (@jobs) { 
     45    while (my $job = $job_iter->()) { 
    4346        my $fi_id = $job->uniqkey; 
    4447        my $fi = MT::FileInfo->load($fi_id);