12345678910111213141516 |
- import { pubClient } from "../connection/redis.js";
- const updateUser = async (userId, userObj) => {
- await pubClient.hSet(userId, userObj.from, JSON.stringify(userObj));
- await pubClient.expire(userId, 60 * 60 * 24);
- };
- const removeRoomAllUsers = (roomId) => {
- return pubClient.del(roomId);
- };
- const removeRoomUser = (roomId, useId) => {
- return pubClient.hDel(roomId, useId);
- };
- export { updateUser, removeRoomAllUsers, removeRoomUser };
|