Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DB_RESULT_LIMIT Parsing to Allow Integer Configuration #999

Merged
merged 3 commits into from
Jan 4, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion emission/core/get_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
db_config[key] = None
print("Retrieved config: %s" % db_config)
url = config.get("DB_HOST", "localhost")
result_limit = config.get("DB_RESULT_LIMIT", 250000)
try:
result_limit = int(config.get("DB_RESULT_LIMIT", 250000))
except ValueError:
result_limit = 250000

try:
parsed=pymongo.uri_parser.parse_uri(url)
Expand Down
Loading