Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wait_until_weaviate_is_ready function #17

Open
dirkkul opened this issue Jan 19, 2023 · 2 comments
Open

Add wait_until_weaviate_is_ready function #17

dirkkul opened this issue Jan 19, 2023 · 2 comments

Comments

@dirkkul
Copy link
Contributor

dirkkul commented Jan 19, 2023

Add a function that checks if weaviate is responding on the given url:port and blocks until it does or a given timeout has passed

@parkerduckworth
Copy link
Member

Hey @dirkkul, is this issue already satisfied here?

for port in $(all_weaviate_ports); do
   # pulling all images usually takes < 3 min
  # starting weaviate usually takes < 2 min
  i="0"
  STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" localhost:"$port"/v1/.well-known/ready)

  while [ "$STATUS_CODE" -ne 200 ]; do
    i=$(($i+5))
    echo "Sleep $i"
    sleep 5
    if [ $i -gt 300 ]; then
      echo "Weaviate did not start in time"
      exit 1
    fi
    STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" localhost:"$port"/v1/.well-known/ready)
  done
  echo "Weaviate on port $port is up and running"
done

@dirkkul
Copy link
Contributor Author

dirkkul commented Jan 31, 2023

Yes, but we wanted to have this behaviour as part of the client so our users can benefit from it :)

@dirkkul dirkkul transferred this issue from weaviate/weaviate-javascript-client Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants