From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18C21C2BA15 for ; Sun, 5 Apr 2020 15:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9FA920672 for ; Sun, 5 Apr 2020 15:28:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="or45Ts/0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbgDEPYq (ORCPT ); Sun, 5 Apr 2020 11:24:46 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35409 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbgDEPYq (ORCPT ); Sun, 5 Apr 2020 11:24:46 -0400 Received: by mail-wr1-f66.google.com with SMTP id g3so12049704wrx.2 for ; Sun, 05 Apr 2020 08:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KHYtTZU7PN3pl+3vLZ2ABZiFvk7rvGj7Qa912rcnf/8=; b=or45Ts/0LBsG9tPpGeLNmGStE8NAmuY/bcOQ0+mjM3/ioh1NTVL9oCB2MSbHQ6ahPJ cCA8djv0U2U0GLAOubaKlHCSYbv6Z/69e5cey49FBl2/QXbw4bHdKebiBfvtqt1tOlRh snr7Wn4LfRnD4WGikeYuEcmGeEeyaJHp9tVfo1xRhIfN6yQLOcMTbDnMVIr6mPkH2B/I iIeBL2cXWeiQO38DEfNuYghMdMYs2zi0CLqDM9YBeJXGNR2emHx7nROnMQuj/M4Ojrex IEnVtWOxQ/8CUBXwASHH4dIcSz626eODjqBNesmCCn9Wd86MkUxXHcrFmxd3VIv/fatg Ih3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KHYtTZU7PN3pl+3vLZ2ABZiFvk7rvGj7Qa912rcnf/8=; b=P7vgqU7wVgEMlsCpPMXhupMC4dgjHiDcl1qZJCiu87tAf9uxqms2p5PYAjBPueK6pP QLvWkO4DhrYmtVm2AKhJT03f6+lkhbr0qqN26nHuWMvQKARzM60zXkIvhWiZBqQbeJUe 0P/b5NHRRNzsccZNtRI1x4uOdljQdvSL4AfIV9usZGQIiHNvanWaUBrR4jbONoppiqfO byDiq7Jx6jU1FSZeMwS01gham+p1eefHp4ZcG/ZRYQyHOns+KSnddOA8RYd47dTdOrno ZDwHPFLYx9c2ru140KQ0RNIsfSF/+49fcPuXEMsoHia+RFafHB8S1bdL5WWS9VkSwo+h fyQw== X-Gm-Message-State: AGi0Pub6T24fx+s5FwqmOT92LTPFfC5pwQuG/FerP4CTN2GGlQUn+Spm fpboiwQQNBggjk4JbWO15s8= X-Google-Smtp-Source: APiQypL0+QFojymNRGV9cNBP4M7OqfVe1FLlEQcjo00jeWzC6GGBRVf5HHp25r9cka4ugHvSCjukGA== X-Received: by 2002:adf:f5cb:: with SMTP id k11mr17292585wrp.387.1586100282539; Sun, 05 Apr 2020 08:24:42 -0700 (PDT) Received: from [192.168.1.240] (85.25.198.146.dyn.plus.net. [146.198.25.85]) by smtp.gmail.com with ESMTPSA id c17sm16477932wrp.28.2020.04.05.08.24.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Apr 2020 08:24:41 -0700 (PDT) Reply-To: phillip.wood@dunelm.org.uk Subject: Re: [PATCH 10/15] job-runner: use config to limit job frequency To: Derrick Stolee via GitGitGadget , git@vger.kernel.org Cc: peff@peff.net, jrnieder@google.com, stolee@gmail.com, Derrick Stolee References: <18429182ffcf4cb56fcf3d8c76e41652a6c45adc.1585946894.git.gitgitgadget@gmail.com> From: Phillip Wood Message-ID: Date: Sun, 5 Apr 2020 16:24:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <18429182ffcf4cb56fcf3d8c76e41652a6c45adc.1585946894.git.gitgitgadget@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB-large Content-Transfer-Encoding: 7bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Stolee On 03/04/2020 21:48, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee > > We want to run different maintenance tasks at different rates. That > means we cannot rely only on the time between job-runner loop pauses > to reduce the frequency of specific jobs. This means we need to > persist a timestamp for the previous run somewhere. A natural place > is the Git config file for that repo. > > Create the job..lastRun config option to store the > timestamp of the previous run of that job. Set this config option > after a successful run of 'git -C run-job '. > > To maximize code reuse, we dynamically construct the config key > and parse the config value into a timestamp in a generic way. This > makes the introduction of another config option extremely trivial: > > The job..interval option allows a user to specify a > minimum number of seconds between two calls to 'git run-job > ' on a given repo. This could be stored in the global > or system config to provide an update on the default for all repos, > or could be updated on a per-repo basis. This is checked on every > iteration of the job loop, so a user could update this and see the > effect without restarting the job-runner process. > > RFC QUESTION: I'm using a 'git -C config