From cdbf94746d875e06cacc02c82c1350aa9f7928c3 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 4 Mar 2019 09:11:29 +0100 Subject: [PATCH] tasks: Minimize races filing issues for bots We don't need to file or check for these issues on every iteration through the .tasks script. These will count as "work done" and thus skip the sleep (even though the "work" lasts only a split-second), and are prone to creating duplicates. Similar to https://github.com/cockpit-project/cockpit/commit/af2e934a Closes #147 --- .tasks | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.tasks b/.tasks index 8da62e5..7fdc60d 100755 --- a/.tasks +++ b/.tasks @@ -1,7 +1,16 @@ #!/bin/sh -# Open issues for things that need doing on a regular basis -bots/npm-trigger +# When run automated, randomize to minimize stampeding herd +if [ -t 0 ]; then + chance=10 +else + chance=$(shuf -i 0-10 -n 1) +fi + +if [ $chance -gt 9 ]; then + # Open issues for things that need doing on a regular basis + bots/npm-trigger +fi # Find those issues and propose to do them bots/issue-scan