@@ -46,6 +46,8 @@ __PACKAGE__->add_columns(
|
||||
{ data_type => "boolean", is_nullable => 1 },
|
||||
"device_key",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"backend",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -371,7 +371,6 @@ sub renumber {
|
||||
|
||||
$schema->resultset('Admin')->search({
|
||||
device => $old_ip,
|
||||
status => { '-not_like' => 'queued-%' },
|
||||
})->delete;
|
||||
|
||||
$device->update({
|
||||
|
||||
@@ -24,7 +24,7 @@ __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
|
||||
WHERE action IN ( 'discover', 'macsuck', 'arpnip', 'nbtstat' )
|
||||
GROUP BY action, entered
|
||||
HAVING count( device ) > 1
|
||||
AND SUM( CASE WHEN status LIKE 'queued%' THEN 1 ELSE 0 END ) = 0
|
||||
AND SUM( CASE WHEN status = 'queued' THEN 1 ELSE 0 END ) = 0
|
||||
ORDER BY entered DESC, elapsed DESC
|
||||
LIMIT 30
|
||||
ENDSQL
|
||||
|
||||
@@ -16,6 +16,7 @@ __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
|
||||
ON (ds.backend = ? AND admin.device = ds.device
|
||||
AND admin.action = ANY (ds.actionset))
|
||||
WHERE admin.status = 'queued'
|
||||
AND admin.backend IS NULL
|
||||
AND ds.device IS NULL)
|
||||
|
||||
SELECT my_jobs.*,
|
||||
|
||||
@@ -15,6 +15,7 @@ __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
|
||||
|
||||
LEFT OUTER JOIN admin ON (device.ip = admin.device
|
||||
AND admin.status = 'queued'
|
||||
AND admin.backend IS NULL
|
||||
AND admin.action = ?)
|
||||
|
||||
FULL OUTER JOIN device_skip ON (device_skip.device = device.ip
|
||||
|
||||
@@ -730,7 +730,6 @@ sub delete {
|
||||
|
||||
$schema->resultset('Admin')->search({
|
||||
device => { '-in' => $devices->as_query },
|
||||
status => { '-not_like' => 'queued-%' },
|
||||
})->delete;
|
||||
|
||||
$schema->resultset('DeviceSkip')->search(
|
||||
|
||||
Reference in New Issue
Block a user