Make expire_nodes and expire_nodes_archive behave correctly
This commit is contained in:
1
Changes
1
Changes
@@ -8,6 +8,7 @@
|
|||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
* Change name of d3 javascript file to force browser reload
|
* Change name of d3 javascript file to force browser reload
|
||||||
|
* Make expire_nodes and expire_nodes_archive behave correctly
|
||||||
|
|
||||||
2.038001 - 2018-01-02
|
2.038001 - 2018-01-02
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,18 @@ sub delete {
|
|||||||
return 0E0;
|
return 0E0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
foreach my $set (qw/
|
||||||
|
NodeMonitor
|
||||||
|
NodeWireless
|
||||||
|
/) {
|
||||||
|
$schema->resultset($set)->search(
|
||||||
|
{ mac => { '-in' => $nodes->as_query }},
|
||||||
|
)->delete;
|
||||||
|
}
|
||||||
|
|
||||||
|
# now let DBIC do its thing
|
||||||
|
my @retval = ($self->next::method());
|
||||||
|
|
||||||
# for node_ip and node_nbt *only* delete if there are no longer
|
# for node_ip and node_nbt *only* delete if there are no longer
|
||||||
# any active nodes referencing the IP or NBT (hence 2nd IN clause).
|
# any active nodes referencing the IP or NBT (hence 2nd IN clause).
|
||||||
foreach my $set (qw/
|
foreach my $set (qw/
|
||||||
@@ -132,17 +144,7 @@ sub delete {
|
|||||||
})->delete;
|
})->delete;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $set (qw/
|
return (wantarray ? @retval : $retval[0]);
|
||||||
NodeMonitor
|
|
||||||
NodeWireless
|
|
||||||
/) {
|
|
||||||
$schema->resultset($set)->search(
|
|
||||||
{ mac => { '-in' => $nodes->as_query }},
|
|
||||||
)->delete;
|
|
||||||
}
|
|
||||||
|
|
||||||
# now let DBIC do its thing
|
|
||||||
return $self->next::method();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user