From b58a5816a9b55e450899b1723f29941042d8fae4 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 6 Oct 2017 07:44:20 +0100 Subject: [PATCH] remove unnecessary check phases --- lib/App/Netdisco/Worker/Plugin/Arpwalk.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/DiscoverAll.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Expire.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Graph.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Macwalk.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Monitor.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Nbtwalk.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Psql.pm | 4 ---- lib/App/Netdisco/Worker/Plugin/Stats.pm | 4 ---- lib/App/Netdisco/Worker/Status.pm | 2 +- 10 files changed, 1 insertion(+), 37 deletions(-) diff --git a/lib/App/Netdisco/Worker/Plugin/Arpwalk.pm b/lib/App/Netdisco/Worker/Plugin/Arpwalk.pm index da341bdc..85d3ae5c 100644 --- a/lib/App/Netdisco/Worker/Plugin/Arpwalk.pm +++ b/lib/App/Netdisco/Worker/Plugin/Arpwalk.pm @@ -7,10 +7,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::JobQueue qw/jq_queued jq_insert/; use Dancer::Plugin::DBIC 'schema'; -register_worker({ stage => 'check' }, sub { - return Status->done('Arpwalk is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; diff --git a/lib/App/Netdisco/Worker/Plugin/DiscoverAll.pm b/lib/App/Netdisco/Worker/Plugin/DiscoverAll.pm index 59bb5447..93eefe1d 100644 --- a/lib/App/Netdisco/Worker/Plugin/DiscoverAll.pm +++ b/lib/App/Netdisco/Worker/Plugin/DiscoverAll.pm @@ -7,10 +7,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::JobQueue qw/jq_queued jq_insert/; use Dancer::Plugin::DBIC 'schema'; -register_worker({ stage => 'check' }, sub { - return Status->done('Discoverall is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; diff --git a/lib/App/Netdisco/Worker/Plugin/Expire.pm b/lib/App/Netdisco/Worker/Plugin/Expire.pm index ad4eb3fd..66e81877 100644 --- a/lib/App/Netdisco/Worker/Plugin/Expire.pm +++ b/lib/App/Netdisco/Worker/Plugin/Expire.pm @@ -7,10 +7,6 @@ use aliased 'App::Netdisco::Worker::Status'; use Dancer::Plugin::DBIC 'schema'; use App::Netdisco::Util::Statistics 'update_stats'; -register_worker({ stage => 'check' }, sub { - return Status->done('Expire is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; diff --git a/lib/App/Netdisco/Worker/Plugin/Graph.pm b/lib/App/Netdisco/Worker/Plugin/Graph.pm index b05fd27b..1d6217db 100644 --- a/lib/App/Netdisco/Worker/Plugin/Graph.pm +++ b/lib/App/Netdisco/Worker/Plugin/Graph.pm @@ -6,10 +6,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::Util::Graph (); -register_worker({ stage => 'check' }, sub { - return Status->done('Graph is able to run'); -}); - register_worker({ stage => 'main' }, sub { App::Netdisco::Util::Graph::graph(); return Status->done('Generated graph data'); diff --git a/lib/App/Netdisco/Worker/Plugin/Macwalk.pm b/lib/App/Netdisco/Worker/Plugin/Macwalk.pm index d22903fc..d09bc0e7 100644 --- a/lib/App/Netdisco/Worker/Plugin/Macwalk.pm +++ b/lib/App/Netdisco/Worker/Plugin/Macwalk.pm @@ -7,10 +7,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::JobQueue qw/jq_queued jq_insert/; use Dancer::Plugin::DBIC 'schema'; -register_worker({ stage => 'check' }, sub { - return Status->done('Macwalk is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; diff --git a/lib/App/Netdisco/Worker/Plugin/Monitor.pm b/lib/App/Netdisco/Worker/Plugin/Monitor.pm index 825b52e0..5b77040f 100644 --- a/lib/App/Netdisco/Worker/Plugin/Monitor.pm +++ b/lib/App/Netdisco/Worker/Plugin/Monitor.pm @@ -6,10 +6,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::Util::NodeMonitor (); -register_worker({ stage => 'check' }, sub { - return Status->done('Monitor is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; App::Netdisco::Util::NodeMonitor::monitor(); diff --git a/lib/App/Netdisco/Worker/Plugin/Nbtwalk.pm b/lib/App/Netdisco/Worker/Plugin/Nbtwalk.pm index 46847f04..be17e802 100644 --- a/lib/App/Netdisco/Worker/Plugin/Nbtwalk.pm +++ b/lib/App/Netdisco/Worker/Plugin/Nbtwalk.pm @@ -7,10 +7,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::JobQueue qw/jq_queued jq_insert/; use Dancer::Plugin::DBIC 'schema'; -register_worker({ stage => 'check' }, sub { - return Status->done('Nbtwalk is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; diff --git a/lib/App/Netdisco/Worker/Plugin/Psql.pm b/lib/App/Netdisco/Worker/Plugin/Psql.pm index c05b600d..099fbb9b 100644 --- a/lib/App/Netdisco/Worker/Plugin/Psql.pm +++ b/lib/App/Netdisco/Worker/Plugin/Psql.pm @@ -4,10 +4,6 @@ use Dancer ':syntax'; use App::Netdisco::Worker::Plugin; use aliased 'App::Netdisco::Worker::Status'; -register_worker({ stage => 'check' }, sub { - return Status->done('Psql is able to run'); -}); - register_worker({ stage => 'main' }, sub { my ($job, $workerconf) = @_; my ($device, $port, $extra) = map {$job->$_} qw/device port extra/; diff --git a/lib/App/Netdisco/Worker/Plugin/Stats.pm b/lib/App/Netdisco/Worker/Plugin/Stats.pm index 88a75087..1d2b0b41 100644 --- a/lib/App/Netdisco/Worker/Plugin/Stats.pm +++ b/lib/App/Netdisco/Worker/Plugin/Stats.pm @@ -6,10 +6,6 @@ use aliased 'App::Netdisco::Worker::Status'; use App::Netdisco::Util::Statistics (); -register_worker({ stage => 'check' }, sub { - return Status->done('Stats is able to run'); -}); - register_worker({ stage => 'main' }, sub { App::Netdisco::Util::Statistics::update_stats(); return Status->done('Updated statistics'); diff --git a/lib/App/Netdisco/Worker/Status.pm b/lib/App/Netdisco/Worker/Status.pm index dd2f3ff4..5d757d37 100644 --- a/lib/App/Netdisco/Worker/Status.pm +++ b/lib/App/Netdisco/Worker/Status.pm @@ -72,7 +72,7 @@ consistency with other Status class methods but really does nothing. sub noop { debug $_[1] if $_[1]; - return 1; + return true; } =head2 is_ok