Skip to content

Commit 4b74299

Browse files
committed
Work on items ending at using sorted set
1 parent 0b03bef commit 4b74299

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/services/queries/items/by-ending-time.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { client } from "$services/redis";
22
import { itemsByEndingAtKey, itemsKey } from "$services/keys";
3+
import { deserialize } from "./deserialize";
34

45
export const itemsByEndingTime = async (
56
order: "DESC" | "ASC" = "DESC",
@@ -14,5 +15,9 @@ export const itemsByEndingTime = async (
1415
},
1516
});
1617

17-
console.log("-------------", ids);
18+
const results = await Promise.all(
19+
ids.map((id) => client.hGetAll(itemsKey(id)))
20+
);
21+
22+
return results.map((item, i) => deserialize(ids[i], item));
1823
};

0 commit comments

Comments
 (0)