This commit is contained in:
2025-04-08 05:48:17 +00:00
parent 75166c60b4
commit 467c436458

View File

@@ -29,6 +29,19 @@ from difflib import SequenceMatcher
import unicodedata
import csv
def retry_on_failure(func):
def wrapper(*args, **kwargs):
for attempt in range(Config.MAX_RETRIES):
try:
return func(*args, **kwargs)
except Exception as e:
print(f"⚠️ Fehler bei {func.__name__} (Versuch {attempt+1}): {str(e)[:100]}")
time.sleep(Config.RETRY_DELAY)
return None
return wrapper
# Optional: tiktoken für Token-Zählung (Modus 8)
try:
import tiktoken