From c2e41dccda9ccadc14f2a7dc05bf91f37b09ce03 Mon Sep 17 00:00:00 2001 From: AnsahMohammad Date: Wed, 8 May 2024 06:59:06 +0530 Subject: [PATCH] feat: added sleep arg in build.sh --- .github/workflows/server_checks.yaml | 3 ++- build.sh | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/server_checks.yaml b/.github/workflows/server_checks.yaml index 53a6f7d..c70374d 100644 --- a/.github/workflows/server_checks.yaml +++ b/.github/workflows/server_checks.yaml @@ -15,11 +15,12 @@ jobs: with: python-version: 3.8 - - name: Install dependencies + - name: Install dependencies & build run: | python -m venv .env source .env/bin/activate pip install -r requirements.txt + bash build.sh 6 - name: Local Flask server Test run: | diff --git a/build.sh b/build.sh index 950b862..5545420 100755 --- a/build.sh +++ b/build.sh @@ -3,17 +3,19 @@ python3 -m venv .env source .env/bin/activate - pip install -r requirements.txt # Check if SUPABASE_URL and SUPABASE_KEY are set if [ -z "$SUPABASE_URL" ] || [ -z "$SUPABASE_KEY" ]; then sleep 1 echo "SUPABASE_URL and SUPABASE_KEY are not set. Crawling..." - python3 -m phantom.phantom --num_threads 5 --urls "https://www.geeksforgeeks.org/" "https://en.wikipedia.org/wiki/India" "https://developers.cloudflare.com/" "https://bloggingidol.com/best-programming-blogs/" "https://www.hindustantimes.com/india-news/" "https://www.bbc.com/news" --show_logs True --print_logs True --sleep 240 + # Use the first argument as the sleep duration, or 240 if no argument is passed + sleep_duration=${1:-240} + python3 -m phantom.phantom --num_threads 5 --urls "https://www.geeksforgeeks.org/" "https://en.wikipedia.org/wiki/India" "https://developers.cloudflare.com/" "https://bloggingidol.com/best-programming-blogs/" "https://www.hindustantimes.com/india-news/" "https://www.bbc.com/news" --show_logs True --print_logs True --sleep $sleep_duration else echo "SUPABASE_URL and SUPABASE_KEY are set. Not crawling." fi + echo "crawling done" clear echo "Installation done" @@ -23,4 +25,4 @@ ls python3 -m phantom.phantom_indexing echo "Phantom Processing done" clear -echo "Build done" +echo "Build done" \ No newline at end of file