File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 51
51
TIME_SINCE_LAST_DISCONNECT=" $(( NOW - LAST_DISCONNECT_TIME)) "
52
52
53
53
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
-
57
54
echo " $( date) : No active connections for $MAX_IDLE_TIME_MINUTES minutes. Shutting down."
58
55
59
56
supervisorctl stop postgresql
60
57
61
58
# Postgres ships the latest WAL file using archive_command during shutdown, in a blocking operation
62
59
# 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
66
61
67
62
kill -s TERM " $( supervisorctl pid) "
68
63
fi
You can’t perform that action at this time.
0 commit comments