Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Log all received webhooks
this.webhook.on('*', async (event: Webhooks.WebhookEvent) => {
await this.receive(event)
})
// Log all webhook errors
this.webhook.on('error', this.errorHandler)
if (options.redisConfig || process.env.REDIS_URL) {
let client
if (options.redisConfig) {
client = new Redis(options.redisConfig)
} else if (process.env.REDIS_URL) {
client = new Redis(process.env.REDIS_URL)
}
const connection = new Bottleneck.IORedisConnection({ client })
connection.on('error', this.logger.error)
this.throttleOptions = {
Bottleneck,
connection
}
}
}