Skip to content

Commit 9013807

Browse files
committed
Add try-catch for redis cache
1 parent e649705 commit 9013807

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/graphql/post.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,15 @@ export const resolvers: IResolvers<any, ApolloContext> = {
707707

708708
const tagsData = await Promise.all(tags.map(Tag.findOrCreate));
709709
await Promise.all([PostsTags.syncPostTags(post.id, tagsData), postRepo.save(post)]);
710-
await Promise.all([is_temp ? null : searchSync.update(post.id), cache.remove(...cacheKeys)]);
710+
711+
try {
712+
await Promise.all([
713+
is_temp ? null : searchSync.update(post.id),
714+
cache.remove(...cacheKeys)
715+
]);
716+
} catch (e) {
717+
console.log(e);
718+
}
711719

712720
return post;
713721
},

0 commit comments

Comments
 (0)