finalize pop-out

This commit is contained in:
overcuriousity
2025-09-16 00:32:46 +02:00
parent ecc143ddbb
commit f0f80be955
3 changed files with 19 additions and 25 deletions

View File

@@ -135,8 +135,8 @@ class Scanner:
'stop_event',
'scan_thread',
'executor',
'processing_lock', # **NEW**: Exclude the processing lock
'task_queue', # PriorityQueue is not picklable
'processing_lock',
'task_queue',
'rate_limiter',
'logger'
]
@@ -147,7 +147,6 @@ class Scanner:
# Handle providers separately to ensure they're picklable
if 'providers' in state:
# The providers should be picklable now, but let's ensure clean state
for provider in state['providers']:
if hasattr(provider, '_stop_event'):
provider._stop_event = None
@@ -162,14 +161,14 @@ class Scanner:
self.stop_event = threading.Event()
self.scan_thread = None
self.executor = None
self.processing_lock = threading.Lock() # **NEW**: Recreate processing lock
self.processing_lock = threading.Lock()
self.task_queue = PriorityQueue()
self.rate_limiter = GlobalRateLimiter(redis.StrictRedis(db=0))
self.logger = get_forensic_logger()
# Re-initialize providers after unpickling from session storage
print("Re-initializing providers after loading session...")
self._initialize_providers()
if not hasattr(self, 'providers') or not self.providers:
print("Providers not found after loading session, re-initializing...")
self._initialize_providers()
if not hasattr(self, 'currently_processing'):
self.currently_processing = set()