[03/10] importer: Just fetch any exception from the executor

Message ID 20220927164847.3409646-3-michael.tremer@ipfire.org
State Accepted
Commit fa33b3215d16d1045c6dc5513d93d2407d7deb37
Headers
Series [01/10] importer: Store geofeed URLs from RIR data |

Commit Message

Michael Tremer Sept. 27, 2022, 4:48 p.m. UTC
  Any exceptions will only be raised in the main thread when they are
fetched from the executor. We do not need to print any other return
values here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/scripts/location-importer.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in
index ddec376..014f3b6 100644
--- a/src/scripts/location-importer.in
+++ b/src/scripts/location-importer.in
@@ -1297,8 +1297,9 @@  class CLI(object):
 		with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
 			results = executor.map(self._fetch_geofeed, geofeeds)
 
+			# Fetch all results to raise any exceptions
 			for result in results:
-				print(result)
+				pass
 
 	def _fetch_geofeed(self, geofeed):
 		log.debug("Fetching Geofeed %s" % geofeed.url)