Skip to content

Commit 8b57c81

Browse files
committed
Modified to match changes made to SC v2.2.38
1 parent 5a431cb commit 8b57c81

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
var redis = require('redis');
22

33
module.exports.attach = function (store) {
4-
var options = store.options;
4+
var storeOptions = store.options.storeOptions;
55
var instanceId = store.instanceId;
66

7-
var subClient = redis.createClient(options.port, options.host, options);
8-
var pubClient = redis.createClient(options.port, options.host, options);
7+
var subClient = redis.createClient(storeOptions.port, storeOptions.host, storeOptions);
8+
var pubClient = redis.createClient(storeOptions.port, storeOptions.host, storeOptions);
99

1010
store.on('subscribe', subClient.subscribe.bind(subClient));
1111
store.on('unsubscribe', subClient.unsubscribe.bind(subClient));
1212
store.on('publish', function (channel, data) {
1313
if (data instanceof Object) {
1414
try {
15-
data = 'o:' + JSON.stringify(data);
15+
data = '/o:' + JSON.stringify(data);
1616
} catch (e) {
17-
data = 's:' + data;
17+
data = '/s:' + data;
1818
}
1919
} else {
20-
data = 's:' + data;
20+
data = '/s:' + data;
2121
}
2222

2323
if (instanceId != null) {
24-
data = instanceId + '/' + data;
24+
data = instanceId + data;
2525
}
2626

2727
pubClient.publish(channel, data);

0 commit comments

Comments
 (0)