Skip to content

Commit 813c7fa

Browse files
authored
chore: remove pg_switch_wal (#713)
* chore: remove pg_switch_wal * chore: remove remnants
1 parent 08b94a4 commit 813c7fa

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

docker/all-in-one/shutdown.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,13 @@ SQL
5151
TIME_SINCE_LAST_DISCONNECT="$((NOW - LAST_DISCONNECT_TIME))"
5252

5353
if [ $TIME_SINCE_LAST_DISCONNECT -gt "$((MAX_IDLE_TIME_MINUTES * 60))" ]; then
54-
LAST_WAL_FILE_NAME=$(run_sql -tA -c "SELECT pg_walfile_name(pg_switch_wal())")
55-
NEW_WAL_FILE_NAME=$(run_sql -tA -c "SELECT pg_walfile_name(pg_current_wal_lsn())")
56-
5754
echo "$(date): No active connections for $MAX_IDLE_TIME_MINUTES minutes. Shutting down."
5855

5956
supervisorctl stop postgresql
6057

6158
# Postgres ships the latest WAL file using archive_command during shutdown, in a blocking operation
6259
# This is to ensure that the WAL file is shipped, just in case
63-
if [ "$LAST_WAL_FILE_NAME" != "$NEW_WAL_FILE_NAME" ]; then
64-
sleep 2
65-
fi
60+
sleep 1
6661

6762
kill -s TERM "$(supervisorctl pid)"
6863
fi

0 commit comments

Comments
 (0)