mirror of
https://github.com/nfstream/nfstream.git
synced 2026-05-22 03:03:29 +00:00
Optimize inactive scan.
This commit is contained in:
parent
e51b0ee5be
commit
b01140ea31
1 changed files with 3 additions and 3 deletions
|
|
@ -103,8 +103,8 @@ class Streamer:
|
|||
self.__flows = LRU(capacity, callback=emergency_callback) # LRU cache
|
||||
self._capacity = self.__flows.get_size() # Streamer capacity (default: 128000)
|
||||
self.active_timeout = active_timeout # expiration active timeout
|
||||
self.inactive_timeout = inactive_timeout # expiration inactive timeout
|
||||
if self.inactive_timeout < 1:
|
||||
self.inactive_timeout = inactive_timeout * 1000 # expiration inactive timeout
|
||||
if self.inactive_timeout < 1000:
|
||||
self.scan_period = 0
|
||||
else:
|
||||
self.scan_period = 1000
|
||||
|
|
@ -167,7 +167,7 @@ class Streamer:
|
|||
while remaining_inactives:
|
||||
try:
|
||||
key, value = self.__flows.peek_last_item()
|
||||
if (self.current_tick - value.end_time) >= (self.inactive_timeout*1000):
|
||||
if (self.current_tick - value.end_time) >= self.inactive_timeout:
|
||||
value.export_reason = 0
|
||||
self.exporter(value)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue