Created
May 4, 2020 13:40
-
-
Save umdstu/e3d2c4d62f0a984f7d6b39547558d8d8 to your computer and use it in GitHub Desktop.
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
do_bypass = False | |
def bypass_wait(): | |
print('this never gets run') | |
do_bypass = True | |
bypass = widgets.Button(description='Skip') | |
bypass.on_click(bypass_wait) | |
display(bypass) | |
async def check_status(objects): | |
while True: | |
try: | |
resp = request.get(url) | |
if do_bypass: | |
break | |
elif resp.status == 1: | |
raise Exception | |
else: | |
break | |
except Exception as e: | |
print('still waiting...') | |
await asyncio.sleep(30) | |
obj = {} | |
await check_status(obj) | |
print('done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment