rename failures column to be deferrals

This commit is contained in:
Oliver Gorwits
2017-05-23 08:26:59 +01:00
parent 96ed444bbb
commit eac1857043
3 changed files with 4 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ __PACKAGE__->add_columns(
{ data_type => "inet", is_nullable => 0 },
"action",
{ data_type => "text", is_nullable => 0 },
"failures",
"deferrals",
{ data_type => "integer", is_nullable => 1, default_value => '0' },
"skipover",
{ data_type => "boolean", is_nullable => 1, default_value => \'false' },

View File

@@ -42,7 +42,7 @@ sub _getsome {
status => 'queued',
device => { '-not_in' => $jobs->correlate('skipped')->search({
backend => $fqdn,
-or => [{ failures => { '>=', 10 } },{ '-bool' => 'skipover' }],
-or => [{ deferrals => { '>=', 10 } },{ '-bool' => 'skipover' }],
}, { columns => 'device' })->as_query },
%$where,
}, { order_by => 'random()', rows => $num_slots });

View File

@@ -4,8 +4,8 @@ CREATE TABLE "device_skip" (
"backend" text NOT NULL,
"device" inet NOT NULL,
"action" text NOT NULL,
"failures" integer DEFAULT 0,
"skipover" boolean DEFAULT false,
"deferrals" integer DEFAULT 0,
"skipover" boolean DEFAULT false,
PRIMARY KEY ("backend", "device", "action")
);