From 0146c2f3a4f2ad776762b1c60a6edb733dd14bc5 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Mon, 31 Jul 2023 20:28:56 +0300 Subject: [PATCH 1/2] chore: remove pg_switch_wal --- docker/all-in-one/shutdown.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker/all-in-one/shutdown.sh b/docker/all-in-one/shutdown.sh index bc4893906..e7cad36e2 100755 --- a/docker/all-in-one/shutdown.sh +++ b/docker/all-in-one/shutdown.sh @@ -51,9 +51,6 @@ 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 From fb389c2139a65800b2e21afd777deed2161b4729 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Tue, 1 Aug 2023 11:40:28 +0300 Subject: [PATCH 2/2] chore: remove remnants --- docker/all-in-one/shutdown.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/all-in-one/shutdown.sh b/docker/all-in-one/shutdown.sh index e7cad36e2..fd035a210 100755 --- a/docker/all-in-one/shutdown.sh +++ b/docker/all-in-one/shutdown.sh @@ -57,9 +57,7 @@ SQL # 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