This commit is contained in:
2024-10-16 18:00:26 +05:00
parent c733675cbc
commit 847cb7983a
+9 -3
View File
@@ -31,6 +31,12 @@ app.get("/active_sessions", async (req, res) => {
res.json(activeSessions);
});
app.get("/builds", async (req, res) => {
const builds = await Build.find();
res.json(builds);
});
app.get("/start", async (req, res) => {
const location = req.query.location as string;
const buildName = req.query.build as string;
@@ -207,7 +213,7 @@ async function checkActiveSessions() {
if (
!activeSession.endAt &&
!activeSession.connectedPlayersCount &&
differenceInMinutes(new Date(), activeSession.updatedAt) > 2
differenceInMinutes(new Date(), activeSession.updatedAt) >= 3
) {
const activeSessionId = activeSession.id;
@@ -284,10 +290,10 @@ async function checkScheduledSessions() {
}
}
cron.schedule("* * * * *", () => {
cron.schedule("* * * * * *", () => {
checkActiveSessions();
});
cron.schedule("* * * * *", () => {
cron.schedule("* * * * * *", () => {
checkScheduledSessions();
});