upd
This commit is contained in:
+9
-3
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user