Skip to content

Commit 90761ca

Browse files
committed
aid_manager: handles empty task queue
1 parent 55241bf commit 90761ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

slips_files/core/aid_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from multiprocessing import Process, Queue
2+
from queue import Empty
23
from threading import Event
34

45
from slips_files.common.slips_utils import utils
@@ -38,7 +39,6 @@ def _worker_loop(self, aid_queue, db: DBManager):
3839
- Initialize DBManager once.
3940
- Loop forever processing tasks.
4041
"""
41-
4242
while not self.stop_profiler_workers_event.is_set():
4343
try:
4444
task = aid_queue.get(timeout=1)
@@ -55,6 +55,8 @@ def _worker_loop(self, aid_queue, db: DBManager):
5555
self.db.add_flow(flow, profileid, twid, label=label)
5656
except KeyboardInterrupt:
5757
continue
58+
except Empty:
59+
continue
5860

5961
def submit_aid_task(self, flow, profileid: str, twid: str, label: str):
6062
"""

0 commit comments

Comments
 (0)