From 813c7fa4e4e5fae7e7067f4746b8a6d53ca5e507 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Tue, 1 Aug 2023 11:41:48 +0300 Subject: [PATCH] chore: remove pg_switch_wal (#713) * chore: remove pg_switch_wal * chore: remove remnants --- docker/all-in-one/shutdown.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docker/all-in-one/shutdown.sh b/docker/all-in-one/shutdown.sh index bc4893906..fd035a210 100755 --- a/docker/all-in-one/shutdown.sh +++ b/docker/all-in-one/shutdown.sh @@ -51,18 +51,13 @@ SQL TIME_SINCE_LAST_DISCONNECT="$((NOW - LAST_DISCONNECT_TIME))" if [ $TIME_SINCE_LAST_DISCONNECT -gt "$((MAX_IDLE_TIME_MINUTES * 60))" ]; then - LAST_WAL_FILE_NAME=$(run_sql -tA -c "SELECT pg_walfile_name(pg_switch_wal())") - NEW_WAL_FILE_NAME=$(run_sql -tA -c "SELECT pg_walfile_name(pg_current_wal_lsn())") - echo "$(date): No active connections for $MAX_IDLE_TIME_MINUTES minutes. Shutting down." supervisorctl stop postgresql # Postgres ships the latest WAL file using archive_command during shutdown, in a blocking operation # This is to ensure that the WAL file is shipped, just in case - if [ "$LAST_WAL_FILE_NAME" != "$NEW_WAL_FILE_NAME" ]; then - sleep 2 - fi + sleep 1 kill -s TERM "$(supervisorctl pid)" fi