You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/03/16 21:09:03 UTC
[05/29] incubator-trafficcontrol git commit: add reval_pending
parameter and modify logic slightly
add reval_pending parameter and modify logic slightly
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/70a13848
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/70a13848
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/70a13848
Branch: refs/heads/master
Commit: 70a13848266b38992c5b6262b73ea4ce55b55c73
Parents: 79a6a23
Author: Derek Gelinas <de...@cable.comcast.com>
Authored: Wed Feb 22 12:39:40 2017 -0500
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Mar 16 15:08:23 2017 -0600
----------------------------------------------------------------------
.../app/db/migrations/20170221190747_add_reval_pending.sql | 4 +++-
traffic_ops/app/lib/MojoPlugins/Job.pm | 3 +--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70a13848/traffic_ops/app/db/migrations/20170221190747_add_reval_pending.sql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20170221190747_add_reval_pending.sql b/traffic_ops/app/db/migrations/20170221190747_add_reval_pending.sql
index 29957cf..85ee402 100644
--- a/traffic_ops/app/db/migrations/20170221190747_add_reval_pending.sql
+++ b/traffic_ops/app/db/migrations/20170221190747_add_reval_pending.sql
@@ -16,7 +16,9 @@
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
ALTER TABLE server ADD COLUMN reval_pending boolean NOT NULL DEFAULT false;
+INSERT INTO parameter (name, config_file, value, secure) VALUES ('use_reval_pending', 'global', '0', False);
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
-ALTER TABLE server DROP COLUMN reval_pending;
\ No newline at end of file
+ALTER TABLE server DROP COLUMN reval_pending;
+delete from parameter where name = 'use_reval_pending';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70a13848/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 2e165ba..f69e926 100755
--- a/traffic_ops/app/lib/MojoPlugins/Job.pm
+++ b/traffic_ops/app/lib/MojoPlugins/Job.pm
@@ -72,8 +72,7 @@ sub register {
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) ) {
+ if ( defined($use_reval_pending) && $use_reval_pending == 1 ) {
my $result = $update_server_bit_rs->update( { reval_pending => 1 } );
&log( $self, "Set reval_pending = 1 for all applicable caches", "OPER" );
}