Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add polling for embedded pg start to create appsmith DB #36854

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deploy/docker/fs/opt/appsmith/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,15 @@ create_appsmith_pg_db() {
# Start the postgres , wait for it to be ready and create a appsmith db
su postgres -c "env PATH='$PATH' pg_ctl -D $POSTGRES_DB_PATH -l $POSTGRES_DB_PATH/logfile start"
echo "Waiting for Postgres to start"
local max_attempts=100
local attempt=0

until su postgres -c "env PATH='$PATH' pg_isready -d postgres"; do
tlog "Waiting for Postgres to be ready..."
if (( attempt >= max_attempts )); then
echo "Postgres failed to start within 100 seconds."
return 1
fi
tlog "Waiting for Postgres to be ready... Attempt $((++attempt))/$max_attempts"
sleep 1
done
# Check if the appsmith DB is present
Expand Down
Loading