private async getLive(client: Socket, liveSlug: string) { const {redisGet, redisSet} = RoomsService.redisClient(client); try { const result = await redisGet(liveSlug); if (!result) { throw new Error('Live not found in redis'); } return JSON.parse(result); } catch (e) { console.error(e); const service: LiveRpc = this.liveRpc.getService('LiveService'); const live = await service.findOne({slug: liveSlug}).toPromise(); await redisSet(liveSlug, JSON.stringify(live)); return live; } }
const liveRpc: LiveRpc = this.liveRpc.getService('LiveService'); const { user_name, email, password, room } = data; const { redisSet } = RoomsService.redisClient(client);