add daily scores set tracking
Some checks are pending
Deploy Website / deploy (push) Waiting to run
Deploy Backend / deploy (push) Successful in 3m51s

This commit is contained in:
Lee
2024-10-15 04:09:47 +01:00
parent 5b3218c205
commit 9d38e095fe
11 changed files with 215 additions and 37 deletions

View File

@ -18,6 +18,7 @@ import { cron } from "@elysiajs/cron";
import { PlayerDocument, PlayerModel } from "./model/player";
import { scoresaberService } from "@ssr/common/service/impl/scoresaber";
import { delay } from "@ssr/common/utils/utils";
import { connectScoreSaberWebSocket } from "@ssr/common/websocket/scoresaber-websocket";
// Load .env file
dotenv.config({
@ -28,8 +29,14 @@ dotenv.config({
await mongoose.connect(Config.mongoUri!); // Connect to MongoDB
setLogLevel("DEBUG");
export const app = new Elysia();
connectScoreSaberWebSocket({
onScore: async score => {
await PlayerService.trackScore(score);
},
});
export const app = new Elysia();
app.use(
cron({
name: "player-statistics-tracker-cron",