meltedchoco commited on
Commit
d924e42
Β·
verified Β·
1 Parent(s): 32994cc

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +3 -3
entrypoint.sh CHANGED
@@ -7,9 +7,9 @@ PG_PORT="${PG_PORT:-5432}"
7
  SEKAI_DB_URL="postgresql://sekai:sekai@/sekai?host=${PGHOST}&port=${PG_PORT}"
8
 
9
  # ── Self-Healing: Check for corrupted state ──────────────────────────
10
- # If the directory exists but is missing critical Postgres folders, wipe it.
11
- if [ -d "${PGDATA}" ] && [ ! -d "${PGDATA}/pg_notify" ]; then
12
- echo "Detected corrupted PostgreSQL data (missing pg_notify). Wiping for a fresh start..."
13
  rm -rf "${PGDATA:?}"/*
14
  fi
15
 
 
7
  SEKAI_DB_URL="postgresql://sekai:sekai@/sekai?host=${PGHOST}&port=${PG_PORT}"
8
 
9
  # ── Self-Healing: Check for corrupted state ──────────────────────────
10
+ # If the directory exists AND is not empty, but is missing PG_VERSION, it's likely corrupted.
11
+ if [ -d "${PGDATA}" ] && [ "$(ls -A ${PGDATA})" ] && [ ! -f "${PGDATA}/PG_VERSION" ]; then
12
+ echo "Detected corrupted or incomplete PostgreSQL data (missing PG_VERSION). Wiping for a fresh start..."
13
  rm -rf "${PGDATA:?}"/*
14
  fi
15