Add translation cache for faster repeated translations (5000 entry LRU cache with hit rate tracking)
This commit is contained in:
4
main.py
4
main.py
@@ -21,6 +21,7 @@ import time
|
||||
from config import config
|
||||
from translators import excel_translator, word_translator, pptx_translator
|
||||
from utils import file_handler, handle_translation_error, DocumentProcessingError
|
||||
from services.translation_service import _translation_cache
|
||||
|
||||
# Import auth routes
|
||||
from routes.auth_routes import router as auth_router
|
||||
@@ -228,7 +229,8 @@ async def health_check():
|
||||
"rate_limits": {
|
||||
"requests_per_minute": rate_limit_config.requests_per_minute,
|
||||
"translations_per_minute": rate_limit_config.translations_per_minute,
|
||||
}
|
||||
},
|
||||
"translation_cache": _translation_cache.stats()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user