Skip to content

Commit

Permalink
Merge pull request #999 from TeachMeTW/Fix-Result-Limit
Browse files Browse the repository at this point in the history
Fix `DB_RESULT_LIMIT` Parsing to Allow Integer Configuration
  • Loading branch information
shankari authored Jan 4, 2025
2 parents 6ab5a5c + 4150b22 commit e19af35
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit e19af35

Please sign in to comment.