diff --git a/.gitignore b/.gitignore index 3f7bf98..7e21fce 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules /build /public/build .env +dump.rdb \ No newline at end of file diff --git a/app/routes/api.room.get.all.tsx b/app/routes/api.room.get.all.tsx index d19abe5..8ffa245 100644 --- a/app/routes/api.room.get.all.tsx +++ b/app/routes/api.room.get.all.tsx @@ -35,9 +35,10 @@ export async function loader({ context, params, request }: LoaderFunctionArgs) { where: eq(rooms.userId, userId || ""), }) .then((roomList) => { - setCache(`kv_roomlist_${userId}`, roomList, "sp").then(() => { - send({ event: userId!, data: JSON.stringify(roomList) }); - }); + Promise.all([ + setCache(`kv_roomlist_${userId}`, roomList, "sp"), + send({ event: userId!, data: JSON.stringify(roomList) }), + ]); }); } }); @@ -59,9 +60,10 @@ export async function loader({ context, params, request }: LoaderFunctionArgs) { where: eq(rooms.userId, userId || ""), }) .then((roomList) => { - setCache(`kv_roomlist_${userId}`, roomList, "sp").then(() => { - send({ event: userId!, data: JSON.stringify(roomList) }); - }); + Promise.all([ + setCache(`kv_roomlist_${userId}`, roomList, "sp"), + send({ event: userId!, data: JSON.stringify(roomList) }), + ]); }); } });