Skip to content

Commit

Permalink
fix(k8s): restore waitForPg delays (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Aug 7, 2020
1 parent 500ccac commit f4bdd1b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Expand Up @@ -110,14 +110,14 @@ spec:
- '-c'
- >
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c \\"SELECT VERSION();\\" > /dev/null 2> /dev/null && [
$retry -gt 0 ];
do
echo \\"Waiting for Postgres to go Green ($(( retry )))\\" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo \\"Not Ready\\";
Expand Down Expand Up @@ -364,14 +364,14 @@ spec:
- '-c'
- >
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c \\"SELECT VERSION();\\" > /dev/null 2> /dev/null && [
$retry -gt 0 ];
do
echo \\"Waiting for Postgres to go Green ($(( retry )))\\" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo \\"Not Ready\\";
Expand Down
Expand Up @@ -110,14 +110,14 @@ spec:
- '-c'
- >
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c \\"SELECT VERSION();\\" > /dev/null 2> /dev/null && [
$retry -gt 0 ];
do
echo \\"Waiting for Postgres to go Green ($(( retry )))\\" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo \\"Not Ready\\";
Expand Down Expand Up @@ -364,14 +364,14 @@ spec:
- '-c'
- >
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c \\"SELECT VERSION();\\" > /dev/null 2> /dev/null && [
$retry -gt 0 ];
do
echo \\"Waiting for Postgres to go Green ($(( retry )))\\" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo \\"Not Ready\\";
Expand Down
Expand Up @@ -92,14 +92,14 @@ spec:
- '-c'
- >
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c \\"SELECT VERSION();\\" > /dev/null 2> /dev/null && [
$retry -gt 0 ];
do
echo \\"Waiting for Postgres to go Green ($(( retry )))\\" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo \\"Not Ready\\";
Expand Down Expand Up @@ -348,14 +348,14 @@ spec:
- '-c'
- >
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c \\"SELECT VERSION();\\" > /dev/null 2> /dev/null && [
$retry -gt 0 ];
do
echo \\"Waiting for Postgres to go Green ($(( retry )))\\" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo \\"Not Ready\\";
Expand Down
4 changes: 2 additions & 2 deletions src/utils/waitForPostgres.ts
Expand Up @@ -7,12 +7,12 @@ interface WaitForPostgresParams {
}

const script = `
retry=5; # 5s * (12 * 10) = 10min
retry=120; # 5s * (12 * 10) = 10min
while ! psql -c "SELECT VERSION();" > /dev/null 2> /dev/null && [ $retry -gt 0 ];
do
echo "Waiting for Postgres to go Green ($(( retry )))" ;
retry=$(( $retry-1 ));
sleep 1s ;
sleep 5s ;
done ;
if [ $retry -eq 0 ]; then
echo "Not Ready";
Expand Down

0 comments on commit f4bdd1b

Please sign in to comment.