fix cli last task started

This commit is contained in:
overcuriousity 2025-09-17 21:35:54 +02:00
parent a56755320c
commit 39b4242200

View File

@ -71,6 +71,7 @@ class Scanner:
self.tasks_skipped = 0 # BUGFIX: Initialize tasks_skipped self.tasks_skipped = 0 # BUGFIX: Initialize tasks_skipped
self.total_tasks_ever_enqueued = 0 self.total_tasks_ever_enqueued = 0
self.current_indicator = "" self.current_indicator = ""
self.last_task_from_queue = None
# Concurrent processing configuration # Concurrent processing configuration
self.max_workers = self.config.max_concurrent_requests self.max_workers = self.config.max_concurrent_requests
@ -210,6 +211,7 @@ class Scanner:
CYAN = "\033[96m" CYAN = "\033[96m"
GREEN = "\033[92m" GREEN = "\033[92m"
YELLOW = "\033[93m" YELLOW = "\033[93m"
BLUE = "\033[94m"
ENDC = "\033[0m" ENDC = "\033[0m"
BOLD = "\033[1m" BOLD = "\033[1m"
@ -234,6 +236,9 @@ class Scanner:
if status_str != last_status_str: if status_str != last_status_str:
print(f"\n{'-'*80}") print(f"\n{'-'*80}")
print(status_str) print(status_str)
if self.last_task_from_queue:
p, pn, ti, d = self.last_task_from_queue
print(f"{BLUE}Last task dequeued -> Prio:{p} | Provider:{pn} | Target:'{ti}' | Depth:{d}{ENDC}")
if in_flight_tasks: if in_flight_tasks:
print(f"{BOLD}{YELLOW}Currently Processing:{ENDC}") print(f"{BOLD}{YELLOW}Currently Processing:{ENDC}")
# Display up to 3 currently processing tasks # Display up to 3 currently processing tasks
@ -308,6 +313,7 @@ class Scanner:
self.tasks_re_enqueued = 0 self.tasks_re_enqueued = 0
self.total_tasks_ever_enqueued = 0 self.total_tasks_ever_enqueued = 0
self.current_indicator = self.current_target self.current_indicator = self.current_target
self.last_task_from_queue = None
self._update_session_state() self._update_session_state()
self.logger = new_session() self.logger = new_session()
@ -367,6 +373,7 @@ class Scanner:
while not self.task_queue.empty() and not self._is_stop_requested(): while not self.task_queue.empty() and not self._is_stop_requested():
try: try:
priority, (provider_name, target_item, depth) = self.task_queue.get() priority, (provider_name, target_item, depth) = self.task_queue.get()
self.last_task_from_queue = (priority, provider_name, target_item, depth)
except IndexError: except IndexError:
break break