Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fbb6c23

Browse files
authored
Update psql_connection_lost_duration_v2.sh
1 parent ad530c8 commit fbb6c23

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎procedures/connection_ping/psql_connection_lost_duration_v2.sh‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,18 @@ echo "Press CTRL+C to stop"
6868
time_start=$(date +%s.%3N)
6969

7070
# произошёл разрыв, пытаемся подключиться
71+
for i in {1..10000}
72+
do
73+
echo "Ping $i. Try connect to $host:$port"
74+
75+
psql -U postgres -q -X -c "\conninfo" -c "call connection_ping(1, 0)" -h $host -p $port
76+
status=$?
77+
78+
79+
sleep 0.1
80+
done
81+
82+
if test $status != 0; then
83+
echoerr "Error occured"
84+
exit $status
85+
fi

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /