TODO: Find better way to handle default request limit

Author: adwaitm1301Created Jul 31, 2026Updated Jul 31, 2026
Labelsenhancement

TODO Comment

# TODO: better way?

Location

File: libretranslate/app.py Line: 142

Code Context

python
def get_routes_limits(args, api_keys_db):
    default_req_limit = args.req_limit
    if default_req_limit == -1:
        # TODO: better way?
        default_req_limit = 999999999999
    
    if api_keys_db:

Description

The current implementation uses a hardcoded large number (999999999999) as the default request limit when default_req_limit is -1. This TODO suggests finding a more elegant or semantic way to handle this case.

Link

View in code

Source: LibreTranslate/LibreTranslate