Created
February 14, 2018 11:20
-
-
Save jakubczaplicki/4aa16c9e58fd4f5c3ff315d7c42f51e9 to your computer and use it in GitHub Desktop.
wait for server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start = time.time() | |
r = requests.get(cls.base_url) | |
while r.status_code != 200: | |
print("Server not ready..") | |
if time.time() - start > 3: | |
raise RuntimeError("Failed to Start Server") | |
time.sleep(0.01) | |
r = requests.get(cls.base_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment