Skip to content

Commit

Permalink
tried to fix the coin spreader hourly process
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed Oct 22, 2024
1 parent 17e0f24 commit 3e19c2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/namespaces/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ export async function giveHourlyCoins() {
.where("active.user_id", "is not", null)
.andWhere("message_totals.messages", ">", 0),
)
// Ajout de GROUP BY pour éviter les doublons
.groupBy(
"user._id",
"user.coins",
"point_totals.points",
"notes.rating",
"given_notes.total",
"active.user_id",
"message_totals.messages",
)

// update the coins of each user
await userTable.query
Expand Down

0 comments on commit 3e19c2e

Please sign in to comment.