Last active
January 2, 2016 02:48
-
-
Save ktkaushik/8239307 to your computer and use it in GitHub Desktop.
Bull redis auth attempts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Does not throw error connecting. Also, does not process jobs | |
| var emailQueue = | |
| Queue('email', 6379, 'SomeInstance.redis.irstack.com', | |
| { auth_pass: 'SomePassword' }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // because redisOptions is an array https://github.com/OptimalBits/bull#queuequeuename-redisport-redishost-redisopts | |
| // throws an error while connecting | |
| var emailQueue = | |
| Queue('email', 6379, 'SomeInstance.redis.irstack.com', | |
| [{ auth_pass: 'SomePassword' }]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var redis = require('redis'); | |
| var emailQueue = | |
| Queue('email'); | |
| emailQueue.client = redis.createClient(6379, 'SomeInstance.redis.irstack.com'); | |
| emailQueue.client.auth('SomePassword'); // https://github.com/mranney/node_redis#clientauthpassword-callback | |
| // This is not really working either. The job never gets processed. |
Author
Look at attempt_3.js. I tried the auth() from the redis package.
Thats becuase emailQueue.client is the redis client
It would be interesting to know if this is a problem related to password or something with the remote redis server. What version of redis are you using?
I'm using RedisCloud and the only way to authenticate is using the auth function
function createClient() {
var client;
if(redisOptions !== undefined && redisOptions.createClient !== undefined){
client = redisOptions.createClient();
}else{
client = redis.createClient(redisPort, redisHost, redisOptions);
}
client.auth("mypassword");
return Promise.promisifyAll(client);
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok, the first attempt should be the correct one. There is no really magic here, the options object is passed directly to the redis client. redisOptions is not an array, the [ ] means here that it is an optional parameter. Now it should be interesting to understand why is not processing jobs.