Correct logic to prevent duplicate queuing of jobs during discover due to previous change in admin table
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
* Respect macsuck_bleed on broken topology detection
|
* Respect macsuck_bleed on broken topology detection
|
||||||
|
* Correct logic to prevent duplicate queuing of jobs during discover due
|
||||||
|
to previous change in admin table
|
||||||
|
|
||||||
2.020001 - 2013-12-08
|
2.020001 - 2013-12-08
|
||||||
|
|
||||||
|
|||||||
@@ -848,14 +848,21 @@ sub discover_new_neighbors {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
# could fail if queued job already exists
|
# Don't queued if job already exists
|
||||||
try {
|
my $is_queued = schema('netdisco')->resultset('Admin')->search(
|
||||||
schema('netdisco')->resultset('Admin')->create({
|
{ device => $ip,
|
||||||
device => $ip,
|
|
||||||
action => 'discover',
|
action => 'discover',
|
||||||
status => 'queued',
|
status => { -like => 'queued%' },
|
||||||
});
|
}
|
||||||
};
|
)->single;
|
||||||
|
unless ($is_queued) {
|
||||||
|
schema('netdisco')->resultset('Admin')->create(
|
||||||
|
{ device => $ip,
|
||||||
|
action => 'discover',
|
||||||
|
status => 'queued',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user