refactor(backend): split log files into separate file

This commit is contained in:
2025-01-19 16:43:00 +01:00
parent e9cc56d7ee
commit f106460502
24 changed files with 155 additions and 113 deletions

View File

@@ -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));
}