Skip to content

Commit

Permalink
Added exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TeachMeTW committed Dec 9, 2024
1 parent 0254ee1 commit c09665e
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 = int(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 c09665e

Please sign in to comment.