Skip to content

Commit

Permalink
Add piper encoding null check (#2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism authored Nov 29, 2024
1 parent c027424 commit e1332a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/structures/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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.`,
);
Expand Down

0 comments on commit e1332a8

Please sign in to comment.