mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-17 20:32:56 +00:00
Add redis configuration to streaming API
This commit is contained in:
parent
b6c922f169
commit
d1a01dbbdd
|
@ -78,7 +78,11 @@ const streamFrom = (id, req, res, needsFiltering = false) => {
|
||||||
res.setHeader('Content-Type', 'text/event-stream')
|
res.setHeader('Content-Type', 'text/event-stream')
|
||||||
res.setHeader('Transfer-Encoding', 'chunked')
|
res.setHeader('Transfer-Encoding', 'chunked')
|
||||||
|
|
||||||
const redisClient = redis.createClient()
|
const redisClient = redis.createClient({
|
||||||
|
host: process.env.REDIS_HOST || '127.0.0.1',
|
||||||
|
port: process.env.REDIS_PORT || 6379,
|
||||||
|
password: process.env.REDIS_PASSWORD
|
||||||
|
})
|
||||||
|
|
||||||
redisClient.on('message', (channel, message) => {
|
redisClient.on('message', (channel, message) => {
|
||||||
const { event, payload } = JSON.parse(message)
|
const { event, payload } = JSON.parse(message)
|
||||||
|
|
Loading…
Reference in a new issue