Browse Source

add a limit to the download loop

Daniel Gatis 1 year ago
parent
commit
95b81143c9
1 changed files with 9 additions and 2 deletions
  1. 9 2
      .github/workflows/test_install.yml

+ 9 - 2
.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