docker
docker copied to clipboard
Update wait-for-psql.py
In your original code, the following line prints the error if the database connection fails: print("Database connection failure: %s" % error, file=sys.stderr) This simply displays the error message stored in the error variable, but it doesn't give any indication of how long the script attempted to connect to the database before failing. print(f"Database connection failure after {int(time.time() - start_time)} seconds: {error}", file=sys.stderr)