Update redis

This commit is contained in:
Jonathan Cremin 2015-09-01 14:09:52 +02:00
parent 9af2720b4a
commit 0cc1cb7939
4 changed files with 7 additions and 10 deletions

View file

@ -2,7 +2,7 @@ import path from 'path';
import fs from 'fs'; import fs from 'fs';
import crypto from 'crypto'; import crypto from 'crypto';
import gm from 'gm'; import gm from 'gm';
import redis from 'redis-url'; import redis from 'redis';
import parse from 'co-busboy'; import parse from 'co-busboy';
import { upload as s3Upload } from '../../lib/s3'; import { upload as s3Upload } from '../../lib/s3';
import { sniff } from '../../lib/type'; import { sniff } from '../../lib/type';
@ -260,7 +260,7 @@ export function* del() {
export function* events() { export function* events() {
const pubsub = redis.connect(redisUrl); const pubsub = redis.createClient(redisUrl);
pubsub.on('ready', () => { pubsub.on('ready', () => {
pubsub.subscribe(this.path); pubsub.subscribe(this.path);
}); });

View file

@ -1,5 +1,5 @@
import uuid from 'node-uuid'; import uuid from 'node-uuid';
import redis from 'redis-url'; import redis from 'redis';
import co from 'co'; import co from 'co';
import passwords from 'passwords'; import passwords from 'passwords';
@ -56,7 +56,7 @@ export function* settings() {
} }
export function* events() { export function* events() {
const pubsub = redis.connect(redisUrl); const pubsub = redis.createClient(redisUrl);
pubsub.on('message', (channel, message) => { pubsub.on('message', (channel, message) => {
this.websocket.send(message); this.websocket.send(message);
}); });

View file

@ -1,15 +1,13 @@
import redis from 'redis-url'; import redis from 'redis';
import coRedis from 'co-redis'; import coRedis from 'co-redis';
import koaRedis from 'koa-redis'; import koaRedis from 'koa-redis';
import session from 'koa-generic-session'; import session from 'koa-generic-session';
import debugname from 'debug'; import debugname from 'debug';
const debug = debugname('hostr:redis'); const debug = debugname('hostr:redis');
const redisUrl = process.env.REDIS_URL;
const connection = new Promise((resolve, reject) => { const connection = new Promise((resolve, reject) => {
debug('Connecting to Redis'); debug('Connecting to Redis');
const client = redis.connect(redisUrl); const client = redis.createClient(process.env.REDIS_URL);
client.on('error', reject); client.on('error', reject);
resolve(client); resolve(client);
}).catch((err) => { }).catch((err) => {

View file

@ -60,8 +60,7 @@
"node-uuid": "~1.4.3", "node-uuid": "~1.4.3",
"passwords": "~1.3.0", "passwords": "~1.3.0",
"raven": "~0.8.1", "raven": "~0.8.1",
"redis": "~0.12.1", "redis": "~1.0.0",
"redis-url": "~1.2.1",
"s3-upload-stream": "~1.0.7", "s3-upload-stream": "~1.0.7",
"statsy": "~0.2.0", "statsy": "~0.2.0",
"stripe": "~3.7.1", "stripe": "~3.7.1",