File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change 2828with open (BASE_DIR / "pyproject.toml" , "rb" ) as f :
2929 pyproject = tomllib .load (f )
3030 VERSION = pyproject ["project" ]["version" ]
31+ LT_TIMEOUT = int (os .environ .get ("LT_TIMEOUT" , '5' ))
3132
3233X_FRAME_OPTIONS = os .environ .get ("X_FRAME_OPTIONS" , "DENY" )
3334
Original file line number Diff line number Diff line change @@ -615,7 +615,7 @@ def _api_request(
615615 req .add_header ("Content-Type" , "application/x-www-form-urlencoded" )
616616 req .add_header ("User-Agent" , "LibreTranslateAgent/1.0" )
617617
618- with request .urlopen (req , timeout = 5 ) as response :
618+ with request .urlopen (req , timeout = settings . LT_TIMEOUT ) as response :
619619 response_str = response .read ().decode ("utf-8" )
620620 return json .loads (response_str )
621621 except Exception as e :
You can’t perform that action at this time.
0 commit comments