Skip to content

Commit

Permalink
[#131 state:committed] Replaced an instance in MT::Worker::Publish wh…
Browse files Browse the repository at this point in the history
…ere the mt_sync task class name, MT::Worker::Sync, was hard coded instead of being pulled from the registry. This eliminated the possibility of reliable overrides by plugins.
  • Loading branch information
jayallen committed Aug 17, 2009
1 parent 946fd3d commit 9aac1a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/MT/Worker/Publish.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ sub work {
$job_iter = sub { shift @jobs };
}

my $sync = MT->config('SyncTarget');
my $task_workers = MT->registry('task_workers') || {};
my $sync_task = $task_workers->{mt_sync};
my $sync = MT->config('SyncTarget') if $sync_task;

my $start = [gettimeofday];
my $rebuilt = 0;
Expand Down Expand Up @@ -86,7 +88,7 @@ sub work {
if (defined $res) {
if ( $sync ) {
my $sync_job = TheSchwartz::Job->new();
$sync_job->funcname('MT::Worker::Sync');
$sync_job->funcname( $sync_task->{class} );
$sync_job->uniqkey($fi_id);
$sync_job->coalesce($job->coalesce) if $job->coalesce;
$sync_job->priority($job->priority) if $job->priority;
Expand Down

0 comments on commit 9aac1a1

Please sign in to comment.