Skip to content

Commit

Permalink
remove conditional for userscore model sync
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Oct 8, 2024
1 parent 490024e commit fc9d85a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/services/cronJobs/syncUsersModelScore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ export const updateUsersWithoutMBDScoreInRound = async () => {
userWallet: user?.walletAddress?.toLowerCase(),
});
logger.debug(`User with ${user?.id} has score of ${userScore}`);
if (userScore) {
await UserQfRoundModelScore.query(`
INSERT INTO "user_qf_round_model_score" ("userId", "qfRoundId", "score", "createdAt", "updatedAt")
VALUES ('${userId}', '${activeQfRoundId}', ${userScore}, NOW(), NOW());
`);
logger.debug(`${user.id} score saved!`);
}
await UserQfRoundModelScore.query(`
INSERT INTO "user_qf_round_model_score" ("userId", "qfRoundId", "score", "createdAt", "updatedAt")
VALUES ('${userId}', '${activeQfRoundId}', ${userScore}, NOW(), NOW());
`);
logger.debug(`${user.id} score saved!`);
} catch (e) {
logger.info(`User with Id ${userId} did not sync MBD score this batch`);
}
Expand Down

0 comments on commit fc9d85a

Please sign in to comment.