Also output the exception when the Redis ping fails

This commit is contained in:
Trenton Holmes 2022-05-23 15:53:47 -07:00
parent d0ee203265
commit efcfecca10

View File

@ -26,9 +26,11 @@ if __name__ == "__main__":
try: try:
client.ping() client.ping()
break break
except Exception: except Exception as e:
print( print(
f"Redis ping #{attempt} failed, waiting {RETRY_SLEEP_SECONDS}s", f"Redis ping #{attempt} failed.\n"
f"Error: {str(e)}.\n"
f"Waiting {RETRY_SLEEP_SECONDS}s",
flush=True, flush=True,
) )
time.sleep(RETRY_SLEEP_SECONDS) time.sleep(RETRY_SLEEP_SECONDS)