send statuscard update on user-specific channel

This commit is contained in:
Rob Colbert 2019-08-28 03:00:57 -04:00
parent 81e8b3294f
commit 3b1cfd4253

View File

@ -535,7 +535,7 @@ const startWorker = (workerId) => {
app.use(errorMiddleware); app.use(errorMiddleware);
app.get('/api/v1/streaming/statuscard', (req, res) => { app.get('/api/v1/streaming/statuscard', (req, res) => {
const channel = `statuscard`; const channel = `statuscard:${req.accountId}`;
streamFrom(channel, req, streamToHttp(req, res), streamHttpEnd(req, subscriptionHeartbeat(channel))); streamFrom(channel, req, streamToHttp(req, res), streamHttpEnd(req, subscriptionHeartbeat(channel)));
}); });
@ -614,7 +614,7 @@ const startWorker = (workerId) => {
switch(location.query.stream) { switch(location.query.stream) {
case 'statuscard': case 'statuscard':
channel = `statuscard`; channel = `statuscard:${req.accountId}`;
streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel))); streamFrom(channel, req, streamToWs(req, ws), streamWsEnd(req, ws, subscriptionHeartbeat(channel)));
break; break;
case 'user': case 'user':