Skip to content

Commit

Permalink
Add timeout to backup script.
Browse files Browse the repository at this point in the history
  • Loading branch information
casey-rapnicki-bixal committed Apr 23, 2024
1 parent 99305ac commit 3011d13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/database-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
jobs:
backup-database:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions scripts/pipeline/database-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ kill_pids() {

## Wait for the tunnel to finish connecting.
wait_for_tunnel() {
count=0
while : ; do
[ -n "$(grep 'Press Control-C to stop.' backup.txt)" ] && break
echo "Waiting for tunnel..."
[ "${count}" = "60" ] && echo "Connection time out, exiting..." && exit 1
sleep 1
count=$((${count} + 1))
done
}

Expand Down

0 comments on commit 3011d13

Please sign in to comment.