Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Better name for db connection timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Sogard authored and benhutchins committed Jan 18, 2019
1 parent 164d1c0 commit a580af8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Use the following, **required**, environment variables for connecting to another
- `-e TAIGA_DB_USER=...` (defaults to `postgres)`)
- `-e TAIGA_DB_PASSWORD=...` (defaults to the password of the linked `postgres` container)

Taiga will attempt to connect to the DB server for up to TAIGA_DB_MAX_TIMEOUT seconds before exiting.
Taiga will attempt to connect to the DB server for up to TAIGA_DB_CONNECT_TIMEOUT seconds before exiting.

If the `TAIGA_DB_NAME` specified does not already exist on the provided PostgreSQL server, it will be automatically created the the Taiga's installation scripts will run to generate the required tables and default demo data.

Expand Down
6 changes: 3 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
: ${TAIGA_SLEEP:=0}
sleep $TAIGA_SLEEP

: ${TAIGA_DB_MAX_TIMEOUT:=120}
: ${TAIGA_DB_CONNECT_TIMEOUT:=120}
DB_AVAILABLE=false
DB_TEST_START=$(date +%s)

Expand All @@ -18,8 +18,8 @@ if [ -z "$TAIGA_SKIP_DB_CHECK" ]; then

if [ $DB_CHECK_STATUS -eq 1 ]; then
DB_FAILED_TIME=$(date +%s)
if [[ $(($DB_FAILED_TIME-$DB_TEST_START)) -gt $TAIGA_DB_MAX_TIMEOUT ]]; then
echo "Failed to connect to database for more than TAIGA_DB_MAX_TIMEOUT seconds. Exiting..."
if [[ $(($DB_FAILED_TIME-$DB_TEST_START)) -gt $TAIGA_DB_CONNECT_TIMEOUT ]]; then
echo "Failed to connect to database for more than TAIGA_DB_CONNECT_TIMEOUT seconds. Exiting..."
exit 1
fi
echo "Failed to connect to database server or database does not exist."
Expand Down

0 comments on commit a580af8

Please sign in to comment.