Revert "make database connections persistant"

This reverts commit dace781b4e.
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-07-24 16:29:50 +02:00
parent dace781b4e
commit 42b065b0c1

View file

@ -148,6 +148,13 @@ fi
# Modify postgresql.conf
if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then
echo "Setting max connections..."
MEMORY=$(awk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo)
MAX_CONNECTIONS=$((MEMORY/50+3))
if [ -n "$MAX_CONNECTIONS" ]; then
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
fi
# Modify conf
if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf