35 Zeilen
1.1 KiB
Python
35 Zeilen
1.1 KiB
Python
"""
|
|
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)" |