Skip to content

Commit

Permalink
fix: finally fixed it ???
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarMulder committed Jun 17, 2023
1 parent c282445 commit 80ac375
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,22 +393,24 @@ class Fast42 {

private createRedisLimiter(limit: RateLimit, concurrentOffset: number, redisConfig: RedisConfig): Bottleneck {
// Create a redis client
const client = createClient(redisConfig.port, redisConfig.host, {
port: redisConfig.port,
host: redisConfig.host,
password: redisConfig.password,
});
// const client = createClient(redisConfig.port, redisConfig.host, {
// password: redisConfig.password,
// });

client.on('error', function (err) {
console.log('Redis client encountered an error: ', err);
});
// client.on('error', function (err) {
// console.log('Redis client encountered an error: ', err);
// });

const limiter = new Bottleneck({
// Redis options
id: 'fast42',
datastore: 'redis',
clearDatastore: false,
client: client,
clientOptions: {
host: redisConfig.host,
port: redisConfig.port,
password: redisConfig.password,
},

// Hourly rate limit
reservoir: limit.hourly_remaining,
Expand Down

0 comments on commit 80ac375

Please sign in to comment.