Merge pull request #1016 from paperless-ngx/more-redis-wait-info

Feature: Include error information when Redis connection fails
This commit is contained in:
shamoon
2022-05-23 19:12:49 -07:00
committed by GitHub

View File

@@ -26,9 +26,11 @@ if __name__ == "__main__":
try:
client.ping()
break
except Exception:
except Exception as e:
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,
)
time.sleep(RETRY_SLEEP_SECONDS)