dr413677671 / PromptGallery-stable-diffusion-webui

A prompt cookbook worked as stable-diffusion-webui extenstions.
Apache License 2.0
153 stars 16 forks source link

timeout for connectng to http://localhost:5173 #7

Closed B3N50N closed 1 year ago

B3N50N commented 1 year ago

some system are not fast enough for it's cpu, and that will cause the issue when connecting to http://localhost:5173 (timeout) the code you written will try to connect to http://localhost:5173 immediately after the service up, i recommand to change these line (just example) tmp = requests.get("http://localhost:5173") to this line


  wait_time = 0
  if_connect =False

  while if_connect == False and wait_time<=6:
      try:
          tmp = requests.get("http://localhost:5173")
          if_connect = True
      except:
          print(".")
          time.sleep(10)
          wait_time+=1
dr413677671 commented 1 year ago

Hi B3N50N,

Really gooooood suggestion indeed!! The original timeout logic is not good.

I added this in the startup. Should be working now.