Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad committed Sep 27, 2023
1 parent decb5e2 commit be376ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/amqp/lib/AbstractAmqpPublisherMonoSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export abstract class AbstractAmqpPublisherMonoSchema<MessagePayloadType extends
// but if server closes connection unexpectedly (e. g. RabbitMQ is shut down), then we don't land here
// @ts-ignore
if (err.message === 'Channel closed') {
this.logger.error(`AMQP channel closed`)
void this.reconnect()
} else {
throw err
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/amqp/lib/AbstractAmqpPublisherMultiSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export abstract class AbstractAmqpPublisherMultiSchema<MessagePayloadType extend
// but if server closes connection unexpectedly (e. g. RabbitMQ is shut down), then we don't land here
// @ts-ignore
if (err.message === 'Channel closed') {
this.logger.error(`AMQP channel closed`)
void this.reconnect()
} else {
throw err
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions packages/amqp/test/consumers/AmqpPermissionsConsumer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,18 @@ describe('PermissionsConsumer', () => {
})

const updatedUsersPermissions = await waitAndRetry(() => {
const checkResult = checkPermissions(userIds)
if (checkResult) {
return checkResult
}

publisher.publish({
messageType: 'add',
userIds,
permissions: perms,
})

return checkPermissions(userIds)
})
return false
}, 50)

if (null === updatedUsersPermissions) {
throw new Error('Users permissions unexpectedly null')
Expand Down

0 comments on commit be376ab

Please sign in to comment.