Skip to content

Commit

Permalink
Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bskjon committed Jul 6, 2024
1 parent be3c0af commit 11549a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions DynamicRoutingUpdater/NetworkHookHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ def __puller_add(self, nic: str) -> None:
def __puller_remove(self, name: str) -> None:
"""Removes puller
"""
targetThread = next(filter(lambda x: x.name == name, self.nicsPullerThreads))
self.nicsPullerThreads.remove(targetThread)

try:
if (len(self.nicsPullerThreads) > 0):
targetThread = next(filter(lambda x: x.name == name, self.nicsPullerThreads))
self.nicsPullerThreads.remove(targetThread)
except Exception as e:
traceback.print_exc()

def __puller_thread(self, nic: str, waitTime: int = 60) -> None:
"""Thread for pulling on adapter
Expand Down

0 comments on commit 11549a4

Please sign in to comment.