Skip to content

Commit 69e8ca3

Browse files
authored
Merge pull request unclecode#1508 from unclecode/docker/base_config_overrides
unclecode#1505 fix(api): update config handling to only set base config if not provided by user
2 parents d0eb5a6 + a1950af commit 69e8ca3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deploy/docker/api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,13 @@ async def handle_crawl_request(
469469
# await crawler.start()
470470

471471
base_config = config["crawler"]["base_config"]
472-
# Iterate on key-value pairs in global_config then use haseattr to set them
472+
# Iterate on key-value pairs in global_config then use hasattr to set them
473473
for key, value in base_config.items():
474474
if hasattr(crawler_config, key):
475-
setattr(crawler_config, key, value)
475+
current_value = getattr(crawler_config, key)
476+
# Only set base config if user didn't provide a value
477+
if current_value is None or current_value == "":
478+
setattr(crawler_config, key, value)
476479

477480
results = []
478481
func = getattr(crawler, "arun" if len(urls) == 1 else "arun_many")

0 commit comments

Comments
 (0)