You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/02/17 15:33:34 UTC
[7/9] incubator-trafficcontrol git commit: no need to fetch profiles
when queuing updates for servers of a cachegroup (for a certain cdn)
no need to fetch profiles when queuing updates for servers of a cachegroup (for a certain cdn)
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/a06c2030
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/a06c2030
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/a06c2030
Branch: refs/heads/master
Commit: a06c20301952127fe050189737d4d08678e67589
Parents: 7b5a66b
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Feb 16 20:01:38 2017 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Feb 17 08:33:17 2017 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/API/Cachegroup.pm | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/a06c2030/traffic_ops/app/lib/API/Cachegroup.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Cachegroup.pm b/traffic_ops/app/lib/API/Cachegroup.pm
index 2a4a359..d489369 100644
--- a/traffic_ops/app/lib/API/Cachegroup.pm
+++ b/traffic_ops/app/lib/API/Cachegroup.pm
@@ -409,29 +409,20 @@ sub postupdatequeue {
return $self->alert("action should be queue or dequeue.");
}
- my @profiles;
- @profiles = $self->db->resultset('Server')->search(
- { 'cdn.name' => $cdn },
- {
- prefetch => 'cdn',
- select => 'me.profile',
- distinct => 1
- }
- )->get_column('profile')->all();
- my $update = $self->db->resultset('Server')->search(
+ my $servers = $self->db->resultset('Server')->search(
{
-and => [
- cachegroup => $id,
- profile => { -in => \@profiles }
+ cachegroup => $id,
+ cdn_id => $cdn_id
]
}
);
my $response;
my @svrs = ();
- if ( $update->count() > 0 ) {
- $update->update( { upd_pending => $setqueue } );
- my @row = $update->get_column('host_name')->all();
+ if ( $servers->count() > 0 ) {
+ $servers->update( { upd_pending => $setqueue } );
+ my @row = $servers->get_column('host_name')->all();
foreach my $svr (@row) {
push( @svrs, $svr );
}