Skip to content

Commit

Permalink
Merge pull request #155 from Plant-for-the-Planet-org/feature/fix-las…
Browse files Browse the repository at this point in the history
…t-updated-on-stats-upsert

Update stats.lastUpdated on upsert
  • Loading branch information
dhakalaashish authored Feb 27, 2024
2 parents 42e220d + e4c1948 commit 15fd140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/server/src/pages/api/cron/db-cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function shouldContinueDeletion(startTime: number, type_of_cleanup:string = 'dat
async function updateOrCreateStats(metric: string, count: number) {
await prisma.stats.upsert({
where: {metric: metric},
update: {count: {increment: count}},
update: {count: {increment: count}, lastUpdated: new Date()},
create: {
metric: metric,
count: count,
Expand Down

0 comments on commit 15fd140

Please sign in to comment.