change from ignore to skip name
This commit is contained in:
@@ -116,14 +116,14 @@ sub finished_stamp { return (shift)->get_column('finished_stamp') }
|
||||
|
||||
=head1 RELATIONSHIPS
|
||||
|
||||
=head2 ignored
|
||||
=head2 skipped
|
||||
|
||||
Retuns the set of C<device_ignore> entries which may apply to this job. They
|
||||
Retuns the set of C<device_skip> entries which may apply to this job. They
|
||||
match the device IP and job action, and may refer to one or more backends.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( ignored => 'App::Netdisco::DB::Result::DeviceIgnore',
|
||||
__PACKAGE__->has_many( skipped => 'App::Netdisco::DB::Result::DeviceSkip',
|
||||
{ 'foreign.device' => 'self.device', 'foreign.action' => 'self.action' },
|
||||
);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use utf8;
|
||||
package App::Netdisco::DB::Result::DeviceIgnore;
|
||||
package App::Netdisco::DB::Result::DeviceSkip;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
__PACKAGE__->table("device_ignore");
|
||||
__PACKAGE__->table("device_skip");
|
||||
__PACKAGE__->add_columns(
|
||||
"backend",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"failures",
|
||||
{ data_type => "integer", is_nullable => 1, default_value => '0' },
|
||||
"ignore",
|
||||
"skipover",
|
||||
{ data_type => "boolean", is_nullable => 1, default_value => \'false' },
|
||||
);
|
||||
__PACKAGE__->set_primary_key("backend", "device", "action");
|
||||
@@ -35,9 +35,9 @@ sub _getsome {
|
||||
|
||||
my $rs = $jobs->search({
|
||||
status => 'queued',
|
||||
device => { '-not_in' => $jobs->correlate('ignored')->search({
|
||||
device => { '-not_in' => $jobs->correlate('skipped')->search({
|
||||
backend => $fqdn,
|
||||
-or => [{ failures => { '>=', 10 } },{ '-bool' => 'ignore' }],
|
||||
-or => [{ failures => { '>=', 10 } },{ '-bool' => 'skipover' }],
|
||||
}, { columns => 'device' })->as_query },
|
||||
%$where,
|
||||
}, { order_by => 'random()', rows => $num_slots });
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE "device_ignore" (
|
||||
CREATE TABLE "device_skip" (
|
||||
"backend" text NOT NULL,
|
||||
"device" inet NOT NULL,
|
||||
"action" text NOT NULL,
|
||||
"failures" integer DEFAULT 0,
|
||||
"ignore" boolean DEFAULT false,
|
||||
"skipover" boolean DEFAULT false,
|
||||
PRIMARY KEY ("backend", "device", "action")
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user