"Refactor database connections and styling using Tailwind CSS"

This commit is contained in:
2025-05-29 12:58:53 +02:00
parent 5de7f0fa26
commit e0b819c12a
4 changed files with 15 additions and 4 deletions

View File

@@ -4193,6 +4193,17 @@ if __name__ == "__main__":
# Debug-Modus prüfen
debug_mode = len(sys.argv) > 1 and sys.argv[1] == "--debug"
# Windows-spezifische Umgebungsvariablen setzen für bessere Flask-Kompatibilität
if os.name == 'nt' and debug_mode:
# Entferne problematische Werkzeug-Variablen
os.environ.pop('WERKZEUG_SERVER_FD', None)
os.environ.pop('WERKZEUG_RUN_MAIN', None)
# Setze saubere Umgebung
os.environ['FLASK_ENV'] = 'development'
os.environ['PYTHONIOENCODING'] = 'utf-8'
os.environ['PYTHONUTF8'] = '1'
# Windows-spezifisches Signal-Handling für ordnungsgemäßes Shutdown
def signal_handler(sig, frame):
"""Signal-Handler für ordnungsgemäßes Shutdown."""
@@ -4236,8 +4247,8 @@ if __name__ == "__main__":
register_template_helpers(app)
# Queue-Manager für automatische Drucker-Überwachung starten
# Nur im Hauptprozess starten (nicht bei Flask Auto-Reload)
if not debug_mode or os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
# Nur im Produktionsmodus starten (nicht im Debug-Modus)
if not debug_mode:
try:
queue_manager = start_queue_manager()
app_logger.info("✅ Printer Queue Manager erfolgreich gestartet")
@@ -4255,7 +4266,7 @@ if __name__ == "__main__":
except Exception as e:
app_logger.error(f"❌ Fehler beim Starten des Queue-Managers: {str(e)}")
else:
app_logger.info("🔄 Flask Auto-Reload erkannt - Queue Manager wird im Hauptprozess gestartet")
app_logger.info("🔄 Debug-Modus: Queue Manager deaktiviert für Entwicklung")
# Scheduler starten (falls aktiviert)
if SCHEDULER_ENABLED:

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long