Skip to content

Commit

Permalink
feat: added sleep arg in build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
AnsahMohammad committed May 8, 2024
1 parent b2ad036 commit c2e41dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/server_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
8 changes: 5 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -23,4 +25,4 @@ ls
python3 -m phantom.phantom_indexing
echo "Phantom Processing done"
clear
echo "Build done"
echo "Build done"

0 comments on commit c2e41dc

Please sign in to comment.