From e1332a841de130d93b6fa7ca37582820d1ddb215 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Fri, 29 Nov 2024 10:34:04 -0800 Subject: [PATCH] Add piper encoding null check (#2254) --- .github/workflows/upgrade-prod.yml | 2 +- src/structures/session.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upgrade-prod.yml b/.github/workflows/upgrade-prod.yml index b82b7df03..ac3dd775f 100644 --- a/.github/workflows/upgrade-prod.yml +++ b/.github/workflows/upgrade-prod.yml @@ -30,7 +30,7 @@ jobs: - name: Redeploy over SSH run: ssh ${{ secrets.PROD_SSH_USER }}@${{ secrets.PROD_SSH_ADDRESS }} "source ~/.zshrc; ./.github/workflows/redeploy_prod.sh $KMQ_DIR ${{ inputs.image-name }}" - name: Wait for KMQ up - run: timeout 60 bash -c 'until curl -s -o /dev/null -w "%{http_code}" 127.0.0.1:5858/ping | grep -q "^200$"; do sleep 5; done' || { echo "KMQ did not return 200 within 1 minute"; exit 1; } + run: timeout 120 bash -c 'until curl -s -o /dev/null -w "%{http_code}" 127.0.0.1:5858/ping | grep -q "^200$"; do sleep 5; done' || { echo "KMQ did not return 200 within 1 minute"; exit 1; } - name: Run basic options test run: ssh ${{ secrets.PROD_SSH_USER }}@${{ secrets.PROD_SSH_ADDRESS }} "docker exec kmq-prod sh -c '. ./.env && npx ts-node --swc src/test/end-to-end-tests/test-runner-bot.ts --test-suite=BASIC_OPTIONS --debug --stage-delay=5'" - name: Run basic gameplay test diff --git a/src/structures/session.ts b/src/structures/session.ts index fb5280412..0ca3abdff 100644 --- a/src/structures/session.ts +++ b/src/structures/session.ts @@ -1344,7 +1344,8 @@ export default abstract class Session { return; } - if (!this.connection.piper.encoding) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!this.connection.piper?.encoding) { return; } @@ -1355,7 +1356,7 @@ export default abstract class Session { // if still encoding, force stop // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (this.connection.piper.encoding) { + if (this.connection.piper?.encoding) { logger.warn( `gid: ${this.guildID} | Connection is still in encoding state after timeout, force stop.`, );