From 99929c5f72c2520234e218d9da33ac5a1faea830 Mon Sep 17 00:00:00 2001 From: Jan van Doorn Date: Wed, 29 Jun 2016 15:52:17 -0600 Subject: [PATCH] perltidy for the purge stuff --- traffic_ops/app/lib/MojoPlugins/Job.pm | 17 ++++++++++++----- traffic_ops/app/lib/UI/Job.pm | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/traffic_ops/app/lib/MojoPlugins/Job.pm b/traffic_ops/app/lib/MojoPlugins/Job.pm index aa561434e..5d16f9615 100755 --- a/traffic_ops/app/lib/MojoPlugins/Job.pm +++ b/traffic_ops/app/lib/MojoPlugins/Job.pm @@ -100,15 +100,22 @@ sub register { } # Only queue updates for servers that have profiles with the regex_revalidate.config file location parameter. - # If that parameter is not there, other mechanisms (ansible? script?) must be used to copy the - # regex_revalidate.config to the caches. - my @profiles = $self->db->resultset('ProfileParameter')->search( { -and => [ 'parameter.name' => 'location', - 'parameter.config_file' => 'regex_revalidate.config' ] }, { prefetch => [ qw{ parameter profile } ] } )->get_column('profile')->all(); + # If that parameter is not there, other mechanisms (ansible? script?) must be used to copy the + # regex_revalidate.config to the caches. + my @profiles = $self->db->resultset('ProfileParameter')->search( + { + -and => [ + 'parameter.name' => 'location', + 'parameter.config_file' => 'regex_revalidate.config' + ] + }, + { prefetch => [qw{ parameter profile }] } + )->get_column('profile')->all(); my $update_server_bit_rs = $self->db->resultset('Server')->search( { 'me.cdn_id' => $cdn_id, - -and => { status => { 'not in' => \@offstates }, profile => {'in' => \@profiles} } + -and => { status => { 'not in' => \@offstates }, profile => { 'in' => \@profiles } } } ); diff --git a/traffic_ops/app/lib/UI/Job.pm b/traffic_ops/app/lib/UI/Job.pm index 6c508dde5..a7e6bb9b4 100644 --- a/traffic_ops/app/lib/UI/Job.pm +++ b/traffic_ops/app/lib/UI/Job.pm @@ -166,11 +166,11 @@ sub newjob { # my $ds_id = # $self->db->resultset('Deliveryservice')->search( { xml_id => $ds_xml_id }, { prefetch => ['profile'] } )->get_column('id')->single(); - my $rs = $self->db->resultset('Deliveryservice')->search( { 'me.xml_id' => $ds_xml_id }, { prefetch => 'cdn' } )->single; + my $rs = $self->db->resultset('Deliveryservice')->search( { 'me.xml_id' => $ds_xml_id }, { prefetch => 'cdn' } )->single; my $cdn_name = $rs->cdn->name; - my $ds_id = $rs->id; + my $ds_id = $rs->id; $self->snapshot_regex_revalidate($cdn_name); - + $self->set_update_server_bits($ds_id); if ( defined $response{"job"} ) {