diff --git a/core/scanner.py b/core/scanner.py index 358fa48..013f2d4 100644 --- a/core/scanner.py +++ b/core/scanner.py @@ -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() diff --git a/static/js/main.js b/static/js/main.js index 547b59d..a2dcd41 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1770,7 +1770,6 @@ class DNSReconApp { async extractNode(largeEntityId, nodeId) { try { - this.showInfo(`Extraction initiated for ${nodeId}. It will be processed by the scanner.`); const response = await this.apiCall('/api/graph/large-entity/extract', 'POST', { large_entity_id: largeEntityId, node_id: nodeId, @@ -1779,22 +1778,14 @@ class DNSReconApp { if (response.success) { this.showSuccess(response.message); - // The node is now in the queue. We don't need to force a graph update. - // Instead, we just need to update the modal view to show one less item. - const graphResponse = await this.apiCall('/api/graph'); - if (graphResponse.success) { - const updatedLargeEntity = graphResponse.graph.nodes.find(n => n.id === largeEntityId); - if (updatedLargeEntity) { - this.showNodeModal(updatedLargeEntity); - } else { - // The entity might have been dismantled completely if it was the last node - this.hideModal(); - } - } + this.hideModal(); - // If the scanner was idle, it's now running. Start polling. + // If the scanner was idle, it's now running. Start polling to see the new node appear. if (this.scanStatus === 'idle') { this.startPolling(1000); + } else { + // If already scanning, force a quick graph update to see the change sooner. + setTimeout(() => this.updateGraph(), 500); } } else { diff --git a/templates/index.html b/templates/index.html index fdc927f..730ab0b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -94,10 +94,14 @@