commit:     a361f8f2a37c32b5472422245a57581cd5788934
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  2 05:38:41 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep  2 05:38:41 2021 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=a361f8f2

get-git-file: Issue 503 when commit is not found

Issue 503 to suggest retrying more aggressively when the requested
commit is not found.  It usually means that the CI reports haven't been
fetched yet.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 cgi-bin/get-git-file.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cgi-bin/get-git-file.sh b/cgi-bin/get-git-file.sh
index 9451d1e..9721f71 100755
--- a/cgi-bin/get-git-file.sh
+++ b/cgi-bin/get-git-file.sh
@@ -61,7 +61,8 @@ main() {
                lfile=${file}
                tree=( $(git ls-tree "${commit}" "${lfile}" 2>/dev/null) )
                if [[ ! ${tree[*]} ]]; then
-                       echo "Status: 404 Not Found"
+                       echo "Status: 503 Service Unavailable"
+                       echo "Retry-After: 30"
                        echo
                        echo "404 Not Found (if the report was just published, 
you may need to wait a minute or two for sync)"
                        exit 0

Reply via email to