From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qDg3M8h5T2CvagAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 15:14:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sMMHL8h5T2CiTQAA1q6Kng (envelope-from ) for ; Mon, 15 Mar 2021 15:14:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D69A16927 for ; Mon, 15 Mar 2021 16:14:16 +0100 (CET) Received: from localhost ([::1]:37666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLov9-0000m5-Nu for larch@yhetil.org; Mon, 15 Mar 2021 11:14:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLouw-0000kC-C1 for guix-patches@gnu.org; Mon, 15 Mar 2021 11:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLouw-0006fx-4F for guix-patches@gnu.org; Mon, 15 Mar 2021 11:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lLouw-0005ts-08 for guix-patches@gnu.org; Mon, 15 Mar 2021 11:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47158] [PATCH 1/2] substitutes: lookup-narinfos: Return the number of requests made. References: <877dm8fpdg.fsf@cbaines.net> In-Reply-To: <877dm8fpdg.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Mar 2021 15:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47158 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47158@debbugs.gnu.org Received: via spool by 47158-submit@debbugs.gnu.org id=B47158.161582118322606 (code B ref 47158); Mon, 15 Mar 2021 15:14:01 +0000 Received: (at 47158) by debbugs.gnu.org; 15 Mar 2021 15:13:03 +0000 Received: from localhost ([127.0.0.1]:36372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLotz-0005sO-3g for submit@debbugs.gnu.org; Mon, 15 Mar 2021 11:13:03 -0400 Received: from mira.cbaines.net ([212.71.252.8]:60382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLotu-0005rc-Pj for 47158@debbugs.gnu.org; Mon, 15 Mar 2021 11:13:01 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id E28EC27BC52 for <47158@debbugs.gnu.org>; Mon, 15 Mar 2021 15:12:57 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id ee37dd7b for <47158@debbugs.gnu.org>; Mon, 15 Mar 2021 15:12:57 +0000 (UTC) From: Christopher Baines Date: Mon, 15 Mar 2021 15:12:56 +0000 Message-Id: <20210315151257.17384-1-mail@cbaines.net> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615821256; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=GXV1B0c74dKa9XWPa5Z1hHga7En9OAbBhA1EtUpggAY=; b=JFXeRiP7Jjo9+ekpujUwPk9PcFsMt5+run50ttaN5cmMh8Oh3fGrWlpU/emwVwCMUDUMsC v1qrTe6wQs1d51cc4e+4ULNrJJA3wZUN3Pv3Dm+0RQz0yK/+E5pRMpZMhaLVLL0DJrrUYf 50tH2ugk7tvtGDxQHnZpQL19bFdXcQAKZm8tSz94lt1fi++Bg0GlwaoEkpIi8bAixHXSDy sLy+cPeDgrBa4a6QWetU7jCFaDJQNysow/Jl1UKlyi9Le5ENHGOOekUNEdAEltTuU6Mc0Y jBp1STHd2n073Fr4JYwAWbFQnQGXoEQmMRbC5WlP0DmjImP+FvTMvHOmuyOIQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615821256; a=rsa-sha256; cv=none; b=oRVOdKqUawLEBvKYjTN+rC/e/FIm9fFUTOaBLXk5VmoSMDz6pqS8qO7FuAKzW6Ww890tvE +LmFdRjyVCkHIEBiDtLtK/YSgpbe+ZoEWbCM6n2B8qTN+YFIab+oNAWcjO6qB8+ub1qAyy wfUz9Zxv2o9LxQQr3QKz3PcCQJrHBSUR2rb4GJj8I9de+SIIyHOqQmkY3t1mDHAhNvrTV2 ys73ik1Nm+xMcLWM66KOki+4nEA9PJn0FkUEHc1LnaEo3dU4x2QO0eWu0EXg3stHCVC22o tGkW4J0HgAhc6e7Cm8+wEcIjdpwlgFO9NOkrNZlOSfL+OuxVjyEmy5F2b0mMpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 4.10 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 8D69A16927 X-Spam-Score: 4.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: nkGIt4QnwEI6 As an additional value, in addition to the narinfos. This value is useful in the weather script for reporting how many requests to the substitute server were made. * guix/substitutes.scm (lookup-narinfos): Additionally return the number of requests made. --- guix/substitutes.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/guix/substitutes.scm b/guix/substitutes.scm index ef78013659..08f8c24efd 100644 --- a/guix/substitutes.scm +++ b/guix/substitutes.scm @@ -310,13 +310,14 @@ information is available locally." '() '() paths))) - (if (null? missing) - cached - (let ((missing (fetch-narinfos cache missing - #:open-connection open-connection - #:make-progress-reporter - make-progress-reporter))) - (append cached (or missing '())))))) + (values (if (null? missing) + cached + (let ((missing (fetch-narinfos cache missing + #:open-connection open-connection + #:make-progress-reporter + make-progress-reporter))) + (append cached (or missing '())))) + (length missing)))) (define* (lookup-narinfos/diverse caches paths authorized? #:key (open-connection -- 2.30.1