Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Nov 5, 2024
1 parent f21b4d3 commit f1566c4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,16 @@ async function updatePostViews() {
const cacheData = await getAndRemovePostViewsCache();
if (!cacheData.length) return;

await prisma.$transaction(
cacheData.map((d) =>
prisma.post.update({
where: { id: d.id },
data: { views: { increment: d.views } },
})
await prisma
.$transaction(
cacheData.map((d) =>
prisma.post.update({
where: { id: d.id },
data: { views: { increment: d.views } },
})
)
)
);
.catch((err) => console.error(err));
}

function scheduleSuspendedAccountDeletion() {
Expand Down

0 comments on commit f1566c4

Please sign in to comment.