Initial commit
Dieser Commit ist enthalten in:
35
config/implementation_switch.py
Normale Datei
35
config/implementation_switch.py
Normale Datei
@ -0,0 +1,35 @@
|
||||
"""
|
||||
Einfacher Switch zwischen alter und neuer Implementation für schnelles Rollback
|
||||
"""
|
||||
|
||||
|
||||
class ImplementationSwitch:
|
||||
"""Einfacher Switch zwischen alter und neuer Implementation"""
|
||||
|
||||
# Direkt aktivieren im Testbetrieb
|
||||
USE_REFACTORED_CODE = True
|
||||
|
||||
@classmethod
|
||||
def rollback_to_legacy(cls):
|
||||
"""Schneller Rollback wenn nötig"""
|
||||
cls.USE_REFACTORED_CODE = False
|
||||
print("WARNUNG: Rollback zu Legacy-Implementation aktiviert!")
|
||||
|
||||
@classmethod
|
||||
def use_refactored_code(cls):
|
||||
"""Aktiviert die refaktorierte Implementation"""
|
||||
cls.USE_REFACTORED_CODE = True
|
||||
print("INFO: Refaktorierte Implementation aktiviert")
|
||||
|
||||
@classmethod
|
||||
def is_refactored_active(cls) -> bool:
|
||||
"""Prüft ob refaktorierte Implementation aktiv ist"""
|
||||
return cls.USE_REFACTORED_CODE
|
||||
|
||||
@classmethod
|
||||
def get_status(cls) -> str:
|
||||
"""Gibt den aktuellen Status zurück"""
|
||||
if cls.USE_REFACTORED_CODE:
|
||||
return "Refaktorierte Implementation (NEU)"
|
||||
else:
|
||||
return "Legacy Implementation (ALT)"
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren