typescript-client icon indicating copy to clipboard operation
typescript-client copied to clipboard

Add wait_until_weaviate_is_ready function

Open dirkkul opened this issue 2 years ago • 2 comments

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

dirkkul avatar Jan 19 '23 12:01 dirkkul

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

parkerduckworth avatar Jan 31 '23 15:01 parkerduckworth

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

dirkkul avatar Jan 31 '23 15:01 dirkkul

this did not actually help in python - will not do it

dirkkul avatar Jun 12 '24 04:06 dirkkul