JonathanBennett / prerender-redis-cache

MIT License
32 stars 30 forks source link

Fixes #18 NOAUTH Authentication required #19

Closed abarke closed 4 years ago

abarke commented 4 years ago

Simple fix to prevent the redis client error: NOAUTH Authentication required.

Problem: with redis instances that require auth, client.select was called before client.auth

Solution: Reorder the code to first call client.auth

Another simple solution would be to simply pass REDIS_URL to the createClient function. The code if (connection.auth) would then be redundant

var client = redis.createClient(REDIS_URL);

Ref: https://github.com/NodeRedis/node-redis/tree/v.2.8.0#rediscreateclient

redis.createClient(redis_url[, options])
abarke commented 4 years ago

Hey @JonathanBennett any chance of a quick patch and new release?

That would be most appreciated!

JonathanBennett commented 4 years ago

Hi there @abarke - apologies for the delay; missed this.

Will merge and release today.

JonathanBennett commented 4 years ago

Released as version 0.2.1

abarke commented 4 years ago

Awesome thanks!