Description
FALKORDB_PORT is retrieved with inconsistent default types across modules:
Integer default (5 locations):
# api/graph.py, api/git_utils/git_graph.py, api/llm.py
port=os.getenv('FALKORDB_PORT', 6379) # default is int
String default with explicit cast (1 location):
# api/info.py
port=int(os.getenv('FALKORDB_PORT', "6379")) # default is str, explicitly cast
os.getenv() always returns a string when the var is set. When it's not set, the default 6379 (int) is passed directly to the port parameter. Depending on how the FalkorDB client handles the port parameter, this may work by accident or fail silently.
Suggested Fix
Consistently use:
port=int(os.getenv('FALKORDB_PORT', '6379'))
Or better yet, centralize configuration in a single place.
Context
Found during code review of PR #522.
Description
FALKORDB_PORTis retrieved with inconsistent default types across modules:Integer default (5 locations):
String default with explicit cast (1 location):
os.getenv()always returns a string when the var is set. When it's not set, the default6379(int) is passed directly to theportparameter. Depending on how the FalkorDB client handles the port parameter, this may work by accident or fail silently.Suggested Fix
Consistently use:
Or better yet, centralize configuration in a single place.
Context
Found during code review of PR #522.