-
Notifications
You must be signed in to change notification settings - Fork 5
/
redis-oplog.js
47 lines (42 loc) · 1.15 KB
/
redis-oplog.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
import './lib/mongo/mongoCollectionNames'
import { RedisPipe, Events } from './lib/constants'
import { Meteor } from 'meteor/meteor'
import init from './lib/init'
import Config from './lib/config'
import { getRedisListener, getRedisPusher } from './lib/redis/getRedisClient'
import ObservableCollection from './lib/cache/observableCollection'
import { addToWatch, removeFromWatch } from './lib/redis/watchManager'
import { dispatchUpdate, dispatchInsert, dispatchRemove } from './lib/redis/customPublish'
import Vent from './lib/vent/Vent'
const RedisOplog = {
init
}
// Warnings
Meteor.startup(function() {
// eslint-disable-next-line
if (Package.insecure) console.log('RedisOplog does not support the insecure package.')
})
export {
RedisOplog,
ObservableCollection,
RedisPipe,
Config,
Events,
Vent,
getRedisListener,
getRedisPusher,
addToWatch,
removeFromWatch,
dispatchUpdate,
dispatchInsert,
dispatchRemove
}
if (process.env.REDIS_OPLOG_SETTINGS) {
init(JSON.parse(process.env.REDIS_OPLOG_SETTINGS))
}
else if (Meteor.settings.redisOplog) {
init(Meteor.settings.redisOplog)
}
else {
console.error('RedisOplog: No settings found')
}