Added time update from Dispatcher

This commit is contained in:
PxlLoewe
2025-06-02 15:32:09 -07:00
parent af36b82221
commit 41931fd276
5 changed files with 54 additions and 33 deletions

View File

@@ -15,8 +15,8 @@ const removeClosedMissions = async () => {
const now = new Date();
if (!lastAlertTime) return;
// change State to closed if last alert was more than 120 minutes ago
if (lastAlertTime && now.getTime() - lastAlertTime.getTime() > 120 * 60 * 1000) {
// change State to closed if last alert was more than 180 minutes ago
if (lastAlertTime && now.getTime() - lastAlertTime.getTime() > 180 * 60 * 1000) {
const log: MissionLog = {
type: "completed-log",
auto: true,

View File

@@ -71,8 +71,8 @@ export const handleConnectDispatch =
socket.join(`user:${user.id}`); // Dem User-Raum beitreten
io.to(`user:${user.id}`).emit("dispatchers-update", connectedDispatcherEntry);
io.to("dispatchers").emit("dispatchers-update");
io.to("pilots").emit("dispatchers-update");
io.to("dispatchers").emit("dispatchers-update", connectedDispatcherEntry);
io.to("pilots").emit("dispatchers-update", connectedDispatcherEntry);
socket.on("stop-other-transmition", async ({ ownRole, otherRole }) => {
const aircrafts = await prisma.connectedAircraft.findMany({