refactor(backend): split log files into separate file
This commit is contained in:
@@ -15,7 +15,7 @@ type RecommendationResource = {
|
||||
year?: number;
|
||||
};
|
||||
|
||||
const cache = createCache<RecommendationResource>();
|
||||
const cache = createCache<RecommendationResource>("recommendations");
|
||||
|
||||
export async function createRecommendationResource(
|
||||
res: GenericResource,
|
||||
@@ -88,7 +88,7 @@ export async function getSimilarMovies(id: string) {
|
||||
export async function getAllRecommendations(): Promise<
|
||||
RecommendationResource[]
|
||||
> {
|
||||
const keys = cache.keys("recommendations:movie:*");
|
||||
const keys = cache.keys();
|
||||
const res = await Promise.all(keys.map((k) => cache.get(k)));
|
||||
return res.map((r) => JSON.parse(r));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user