From 95b81143c9a1d760c892ffa7f406f055fc244b81 Mon Sep 17 00:00:00 2001 From: Daniel Gatis Date: Mon, 26 Aug 2024 17:41:00 -0300 Subject: [PATCH] add a limit to the download loop --- .github/workflows/test_install.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index dda6ddb6..b7dd6b36 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -19,6 +19,13 @@ jobs: run: pip install .[cli,dev] - name: Test installation with pytest run: | - rembg d - while [ $? -ne 0 ]; do !!; done + attempt=0 + until rembg d || [ $attempt -eq 5 ]; do + attempt=$((attempt+1)) + echo "Attempt $attempt to download the models..." + done + if [ $attempt -eq 5 ]; then + echo "downloading the models failed 5 times, exiting..." + exit 1 + fi pytest