mitchell852 closed pull request #1810: [Issue 1809] prefetch type for ds type
query
URL: https://github.com/apache/incubator-trafficcontrol/pull/1810
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm
index a236bae2df..03264748fc 100644
--- a/traffic_ops/app/lib/API/Cdn.pm
+++ b/traffic_ops/app/lib/API/Cdn.pm
@@ -1205,12 +1205,14 @@ sub refresh_keys {
#get DeliveryServices for CDN
my %search = ( cdn_id => $row->id );
- my @ds_rs =
$self->db->resultset('Deliveryservice')->search( \%search );
+ my @ds_rs =
$self->db->resultset('Deliveryservice')->search( \%search, { prefetch =>
['type'] });
+
foreach my $ds (@ds_rs) {
- if ( $ds->type->name !~ m/^HTTP/
- && $ds->type->name !~
m/^CLIENT_STEERING$/
- && $ds->type->name !~ m/^STEERING$/
- && $ds->type->name !~ m/^DNS/ )
+ my $type = $ds->type->name;
+ if ( $type !~ m/^HTTP/
+ && $type !~ m/^CLIENT_STEERING$/
+ && $type !~ m/^STEERING$/
+ && $type !~ m/^DNS/ )
{
next;
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services