From 3011d131b097b48d53c110b3f7639177ec4d7f19 Mon Sep 17 00:00:00 2001 From: Casey Rapnicki Date: Tue, 23 Apr 2024 12:31:55 -0400 Subject: [PATCH] Add timeout to backup script. --- .github/workflows/database-backup.yml | 1 + scripts/pipeline/database-backup.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/database-backup.yml b/.github/workflows/database-backup.yml index cf85bbab9..c87e6c723 100644 --- a/.github/workflows/database-backup.yml +++ b/.github/workflows/database-backup.yml @@ -17,6 +17,7 @@ on: jobs: backup-database: runs-on: ubuntu-latest + continue-on-error: true steps: - name: Checkout uses: actions/checkout@v4 diff --git a/scripts/pipeline/database-backup.sh b/scripts/pipeline/database-backup.sh index ecf50be46..91a366b09 100755 --- a/scripts/pipeline/database-backup.sh +++ b/scripts/pipeline/database-backup.sh @@ -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 }