From 0254ee108889a2ab682681e212e25b3e5d7fc1ef Mon Sep 17 00:00:00 2001 From: TeachMeTW Date: Mon, 9 Dec 2024 12:42:29 -0800 Subject: [PATCH] fix(db): allow `DB_RESULT_LIMIT` to be set as an integer Previously, `DB_RESULT_LIMIT` was treated as a string, preventing it from being set dynamically. This update ensures it is parsed as an integer, fixing the issue. Updated logic: `result_limit = int(config.get("DB_RESULT_LIMIT", 250000))`. --- emission/core/get_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emission/core/get_database.py b/emission/core/get_database.py index 898973504..7abcf2f84 100644 --- a/emission/core/get_database.py +++ b/emission/core/get_database.py @@ -23,7 +23,7 @@ db_config[key] = None print("Retrieved config: %s" % db_config) url = config.get("DB_HOST", "localhost") -result_limit = config.get("DB_RESULT_LIMIT", 250000) +result_limit = int(config.get("DB_RESULT_LIMIT", 250000)) try: parsed=pymongo.uri_parser.parse_uri(url)