How to use the bottleneck.IORedisConnection function in bottleneck

To help you get started, we’ve selected a few bottleneck examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github probot / probot / src / index.ts View on Github external
// 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
      }
    }
  }

bottleneck

Distributed task scheduler and rate limiter

MIT
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis