Skip to content

Commit

Permalink
add idle purge interval
Browse files Browse the repository at this point in the history
  • Loading branch information
britram committed Oct 10, 2016
1 parent 46ea523 commit 537b666
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pathspider/observer/__init__.py
Expand Up @@ -310,7 +310,8 @@ def flush(self):

self._ignored.clear()

def run_flow_enqueuer(self, flowqueue, irqueue=None):
def run_flow_enqueuer(self, flowqueue, irqueue=None, purge_interval=1000):
# store interrupt queue
if irqueue:
self._irq = irqueue
self._irq_fired = None
Expand All @@ -322,6 +323,8 @@ def run_flow_enqueuer(self, flowqueue, irqueue=None):
f = self._next_flow()
if f:
flowqueue.put(f)
if purge_interval and (self._ct_flow % purge_interval == 0):
self.purge_idle()
else:
self.flush()
break
Expand Down

0 comments on commit 537b666

Please sign in to comment.