Skip to content

Commit c5cfa22

Browse files
committed
refactor restore wait
Signed-off-by: SK Ali Arman <[email protected]>
1 parent a452e36 commit c5cfa22

File tree

2 files changed

+25
-34
lines changed

2 files changed

+25
-34
lines changed

scripts/run.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
#!/usr/bin/env bash
22

3-
RECOVERY_DONE_FILE="/tmp/recovery.done"
4-
if [[ "$PITR_RESTORE" == "true" ]]; then
5-
while true; do
6-
sleep 2
7-
echo "Point In Time Recovery In Progress. Waiting for $RECOVERY_DONE_FILE file"
8-
if [[ -e "$RECOVERY_DONE_FILE" ]]; then
9-
echo "$RECOVERY_DONE_FILE found."
10-
break
11-
fi
12-
done
13-
fi
14-
15-
if [[ -e "$RECOVERY_DONE_FILE" ]]; then
16-
rm $RECOVERY_DONE_FILE
17-
fi
18-
193
script_name=${0##*/}
204

215
function timestamp() {
@@ -45,8 +29,20 @@ while [ true ]; do
4529
if [ -f "/scripts/seqno" ]; then
4630
rm /scripts/seqno
4731
fi
48-
32+
RECOVERY_DONE_FILE="/tmp/recovery.done"
33+
if [[ "$PITR_RESTORE" == "true" ]]; then
34+
while true; do
35+
sleep 2
36+
echo "Point In Time Recovery In Progress. Waiting for $RECOVERY_DONE_FILE file"
37+
if [[ -e "$RECOVERY_DONE_FILE" ]]; then
38+
echo "$RECOVERY_DONE_FILE found."
39+
break
40+
fi
41+
done
42+
fi
4943
# start on-start script
5044
./scripts/on-start.sh $@
5145
sleep 1
5246
done
47+
48+

scripts/std-replication-run.sh

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
#!/usr/bin/env bash
22

3-
RECOVERY_DONE_FILE="/tmp/recovery.done"
4-
if [[ "$PITR_RESTORE" == "true" ]]; then
5-
while true; do
6-
sleep 2
7-
echo "Point In Time Recovery In Progress. Waiting for $RECOVERY_DONE_FILE file"
8-
if [[ -e "$RECOVERY_DONE_FILE" ]]; then
9-
echo "$RECOVERY_DONE_FILE found."
10-
break
11-
fi
12-
done
13-
fi
14-
15-
if [[ -e "$RECOVERY_DONE_FILE" ]]; then
16-
rm $RECOVERY_DONE_FILE
17-
fi
18-
193
script_name=${0##*/}
204

215
function timestamp() {
@@ -45,8 +29,19 @@ while [ true ]; do
4529
if [ -f "/scripts/seqno" ]; then
4630
rm /scripts/seqno
4731
fi
48-
32+
RECOVERY_DONE_FILE="/tmp/recovery.done"
33+
if [[ "$PITR_RESTORE" == "true" ]]; then
34+
while true; do
35+
sleep 2
36+
echo "Point In Time Recovery In Progress. Waiting for $RECOVERY_DONE_FILE file"
37+
if [[ -e "$RECOVERY_DONE_FILE" ]]; then
38+
echo "$RECOVERY_DONE_FILE found."
39+
break
40+
fi
41+
done
42+
fi
4943
# start on-start script
5044
./scripts/std-replication-on-start.sh $@
5145
sleep 1
5246
done
47+

0 commit comments

Comments
 (0)