one possible method of selecting between reval and upd
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/79a6a23c Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/79a6a23c Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/79a6a23c Branch: refs/heads/master Commit: 79a6a23c6f4f0892c7ac089fb39de9b202e38710 Parents: 988a623 Author: Derek Gelinas <derek_geli...@cable.comcast.com> Authored: Tue Feb 21 21:21:48 2017 -0500 Committer: Jeremy Mitchell <mitchell...@gmail.com> Committed: Thu Mar 16 15:08:23 2017 -0600 ---------------------------------------------------------------------- traffic_ops/app/lib/MojoPlugins/Job.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/79a6a23c/traffic_ops/app/lib/MojoPlugins/Job.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/MojoPlugins/Job.pm b/traffic_ops/app/lib/MojoPlugins/Job.pm index 518f53a..2e165ba 100755 --- a/traffic_ops/app/lib/MojoPlugins/Job.pm +++ b/traffic_ops/app/lib/MojoPlugins/Job.pm @@ -70,8 +70,17 @@ sub register { } ); - my $result = $update_server_bit_rs->update( { upd_pending => 1 } ); - &log( $self, "Set upd_pending = 1 for all applicable caches", "OPER" ); + my $use_reval_pending = $self->db->resultset('Parameter')->search( { -and => [ 'name' => 'use_reval_pending', 'config_file' => 'global' ] } )->get_column('value')->single; + + print STDERR Dumper($use_reval_pending); + if ( defined($use_reval_pending) ) { + my $result = $update_server_bit_rs->update( { reval_pending => 1 } ); + &log( $self, "Set reval_pending = 1 for all applicable caches", "OPER" ); + } + else { + my $result = $update_server_bit_rs->update( { upd_pending => 1 } ); + &log( $self, "Set upd_pending = 1 for all applicable caches", "OPER" ); + } } );