gosquared / flutter

Twitter OAuth module for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Because of flutter.connect - it's asking me to install redis

technotip opened this issue · comments

Am using MongoDB for my data storage. When I implement flutter, and try to run node instance, it throws error saying -


events.js:72
throw er; // Unhandled 'error' event
^
Error: Redis connection to localhost:6379 failed - connect ECONNREF
USED
at RedisClient.on_error (C:\TF\node_modules\flutter\node
_modules\redis\index.js:189:24)
at Socket. (C:\TF\node_modules\flutter\node_m
odules\redis\index.js:95:14)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:415:13)
npm ERR! weird error 8
npm ERR! not ok code 0

Can someone give me the solution to this..

I just want to get oauthAccessToken and oauthAccessTokenSecret form flutter.

Looking st the source code: https://github.com/gosquared/flutter/blob/master/src/Flutter.js#L97 it looks likt there is currently no way around this. I suggest we add a flag to the options to bypass the creation of a redisClient. something like

if (!self.cache && !self.cacheEnabled) {
    self.debug('creating redis client');
    self.cache = redis.createClient(self.opts.redis.port, self.opts.redis.host);
    self.cache.select(self.opts.redis.database);
}

I can submit a PR if authors approve.

Besides redis settings being a requirement, it looks like using sessions is also a hard requirement.

fixed this, use

var flutter = new Flutter({ cache: false });