trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mitchell...@apache.org
Subject [incubator-trafficcontrol] branch master updated: prefetch type for ds type query
Date Tue, 30 Jan 2018 15:12:29 GMT
This is an automated email from the ASF dual-hosted git repository.

mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new e1f13a0  prefetch type for ds type query
e1f13a0 is described below

commit e1f13a08ecb6aafdbab65f6f7a1b91d7c199a8e1
Author: Dan Kirkwood <dangogh@apache.org>
AuthorDate: Mon Jan 29 13:24:41 2018 -0700

    prefetch type for ds type query
---
 traffic_ops/app/lib/API/Cdn.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm
index a236bae..0326474 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;
 				}

-- 
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.

Mime
View raw message