-
Notifications
You must be signed in to change notification settings - Fork 1
/
defaults.js
72 lines (58 loc) · 2.23 KB
/
defaults.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import ClusterHook from './hooks/ClusterHook';
import PubSubHook from './hooks/PubSubHook';
/*
Default Configuration
*/
export default function () {
return {
redis: {
// key read mode redis cluster nodes - only applies to cluster connections
// only applies to cluster connections
// see: https://github.com/luin/ioredis#read-write-splitting
scaleReads: 'all',
// disable this if you need to save buffers on redis, keeping this on improves performance
dropBufferSupport: true, // https://github.com/luin/ioredis/wiki/Improve-Performance#dropbuffersupport-option
// prefixes all keys created by the redis clients with this
keyPrefix: 'rdb:',
// how long before a connection request times out - in milliseconds
connectionTimeout: 6000,
// your host name, defaults to a local instance
host: '127.0.0.1',
// server port
port: 6379,
// default db - only applies to non-cluster connections,
db: 0,
// to connect to a cluster provide an array of objects with host and port properties
// hosts: [],
// to connect to a sentinel setup provide an array of objects with host and port properties
// sentinels: [],
},
// config for the core pubsub hook
pubsub: {
// enable if you're going to be subscribing to events
// this creates a separate redis connection internally for sub events.
subscriber: false,
// enable if you're going to be publishing events
// this creates a separate redis connection internally for publishing events.
publisher: false,
// by default all pubsub key/event names are prefixed with this option
eventPrefix: 'rdb',
},
// built in logging options
// this uses winston so for a more detailed view of options see the winston repo:
// https://github.com/winstonjs/winston#using-the-default-logger
log: {
level: 'error',
label: 'RediBox',
colorize: true,
prettyPrint: true,
humanReadableUnhandledException: true,
},
// default core hooks
hooks: {
// built-in core hooks - these can be removed by setting key props to falsey values
cluster: ClusterHook,
pubsub: PubSubHook,
},
};
}