guard against race with *_or_* DBIC methods
This commit is contained in:
@@ -80,8 +80,12 @@ sub do_arpnip {
|
|||||||
|
|
||||||
# update subnets with new networks
|
# update subnets with new networks
|
||||||
foreach my $cidr (@subnets) {
|
foreach my $cidr (@subnets) {
|
||||||
|
try {
|
||||||
|
schema('netdisco')->txn_do(sub {
|
||||||
schema('netdisco')->resultset('Subnet')
|
schema('netdisco')->resultset('Subnet')
|
||||||
->update_or_create({net => $cidr, last_discover => \'now()'});
|
->update_or_create({net => $cidr, last_discover => \'now()'});
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
debug sprintf ' [%s] arpnip - processed %s Subnet entries',
|
debug sprintf ' [%s] arpnip - processed %s Subnet entries',
|
||||||
$device->ip, scalar @subnets;
|
$device->ip, scalar @subnets;
|
||||||
|
|||||||
Reference in New Issue
Block a user