From c9acf764073beec33e4b4b8f866e6cb190c6912f Mon Sep 17 00:00:00 2001 From: J <91372088+jarelllama@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:41:34 +0800 Subject: [PATCH] retrieve: add error handling for if a source is unnaturally large --- scripts/retrieve_domains.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/retrieve_domains.sh b/scripts/retrieve_domains.sh index f8d1bacf4..12c13cb68 100644 --- a/scripts/retrieve_domains.sh +++ b/scripts/retrieve_domains.sh @@ -231,6 +231,11 @@ process_source_results() { # Count number of unfiltered domains raw_count="$(wc -l < "$source_results")" + # Error in case a source wrongly retrieves too many results. + if (( raw_count > 10000 )) then + error 'Source is unusually large.' + fi + # Remove known dead domains (dead domains file is not sorted and includes # subdomains) dead_count="$(filter \