Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

perltidy for the purge stuff #1569

Merged
merged 1 commit into from
Jun 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions traffic_ops/app/lib/MojoPlugins/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
}
);

Expand Down
6 changes: 3 additions & 3 deletions traffic_ops/app/lib/UI/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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"} ) {
Expand Down