nix: Simplify with_tmp_db

This commit is contained in:
Wolfgang Walther
2021-11-24 18:06:56 +01:00
committed by Remo
parent 62243852b6
commit b7dcc63e37
2 changed files with 4 additions and 23 deletions
+1 -7
View File
@@ -60,15 +60,9 @@ let
log "Starting the database cluster..."
# Instead of listening on a local port, we will listen on a unix domain socket.
pg_ctl -l "$tmpdir/db.log" start -o "-F -c listen_addresses=\"\" -k $PGHOST" \
pg_ctl -l "$tmpdir/db.log" -w start -o "-F -c listen_addresses=\"\" -k $PGHOST" \
>> "$setuplog"
log "Waiting for the database cluster to be ready..."
# Waiting is required for older versions of Postgres (< 10).
until pg_isready >> "$setuplog"; do
sleep 0.1
done
stop () {
log "Stopping the database cluster..."
pg_ctl stop -m i >> "$setuplog"