From patchwork Tue Sep 27 16:48:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 6018 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4McQZ26zwjz3whh for ; Tue, 27 Sep 2022 16:48:58 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4McQZ10212z2R1; Tue, 27 Sep 2022 16:48:56 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4McQZ03hgpz301B; Tue, 27 Sep 2022 16:48:56 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4McQYy59LKz2xLr for ; Tue, 27 Sep 2022 16:48:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4McQYy3pFrzDp; Tue, 27 Sep 2022 16:48:54 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1664297334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gVPUWXmvvFMX5mWJdrxid+s7Oyi39oHwEGmkXCZCa8s=; b=huGWv+q4q45VzkQTbLnfTBKqO9M2pQX3cpTOBJ1/na8cC8bB4BTiVkGgyCQQ4jMW4ApWPr cW7l+zT+rbVHUgBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1664297334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gVPUWXmvvFMX5mWJdrxid+s7Oyi39oHwEGmkXCZCa8s=; b=R9WJiTCnfFxek/wyo0FsYtQayrgOW4IlogeiddibyiNgqpgzcqJfZPCMF5i1bgLIH4VKXS l/jrpfkBXRJwvhoeYJTqCOk3DlTCtDGgDSMBe2DgKv1hZfE+WE7DGt+iGpH2MmEukSmRar vXIi5kgXRWj6PO4bl2yZ05Obr6Yh8MQ2pM2IrIX/0Inl0R4ldziJIlpbjS38/4KYmAU7Ms cG2m25eHEkoJKDsOuz0jOeHFNPDla4PgLcouSie7I/Ja+7/dUFmLFUyffppLFEddWCmYyR xdnV4EHhksbTvZeg+AyAhiekSuRlsVnP6xcxqifNoj4vRBDH580eqm/h1ksgHg== From: Michael Tremer To: location@lists.ipfire.org Subject: [PATCH 03/10] importer: Just fetch any exception from the executor Date: Tue, 27 Sep 2022 16:48:40 +0000 Message-Id: <20220927164847.3409646-3-michael.tremer@ipfire.org> In-Reply-To: <20220927164847.3409646-1-michael.tremer@ipfire.org> References: <20220927164847.3409646-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: location-bounces@lists.ipfire.org Sender: "Location" 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 --- src/scripts/location-importer.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)