"feat: Windows socket documentation update

This commit is contained in:
2025-05-29 12:56:27 +02:00
parent ad92d3d978
commit 58edef5cab
7 changed files with 328 additions and 8 deletions

View File

@@ -18,6 +18,15 @@ from contextlib import contextmanager
from models import get_db_session, Job, Printer, User, Notification
from utils.logging_config import get_logger
# Windows-spezifische Imports
if os.name == 'nt':
try:
from utils.windows_fixes import get_windows_thread_manager
except ImportError:
get_windows_thread_manager = None
else:
get_windows_thread_manager = None
# Logger für Queue-Manager
queue_logger = get_logger("queue_manager")
@@ -96,6 +105,18 @@ class PrinterQueueManager:
self.is_running = True
self.shutdown_event.clear()
self.monitor_thread = threading.Thread(target=self._monitor_loop, daemon=False)
self.monitor_thread.name = "PrinterQueueMonitor"
# Windows Thread-Manager verwenden falls verfügbar
if os.name == 'nt' and get_windows_thread_manager:
try:
thread_manager = get_windows_thread_manager()
thread_manager.register_thread(self.monitor_thread)
thread_manager.register_cleanup_function(self.stop)
queue_logger.debug("✅ Queue Manager bei Windows Thread-Manager registriert")
except Exception as e:
queue_logger.warning(f"⚠️ Windows Thread-Manager nicht verfügbar: {str(e)}")
self.monitor_thread.start()
queue_logger.info("✅ Printer Queue Manager erfolgreich gestartet")