Skip to content

Commit

Permalink
chore: set min 10min for inactivity timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Nov 22, 2023
1 parent 0ad9bcd commit 7a20a81
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
1 change: 0 additions & 1 deletion apps/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ model MiscCadSettings {
roleplayEnabled Boolean? @default(true)
authScreenBgImageId String?
authScreenHeaderImageId String?
inactivityTimeout Int?
jailTimeScale JailTimeScale?
// How many times a signal 100 should be repeated.
signal100RepeatAmount Int? @default(1)
Expand Down
3 changes: 1 addition & 2 deletions apps/api/src/lib/data/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { PrismaClient } from "@prisma/client";
import { setDefaultCadFeatures } from "migrations/set-default-cad-features";
import { inactivityFilter } from "migrations/inactivity-filter";

export const prisma = new PrismaClient({
errorFormat: "colorless",
log: ["info", "warn", "error"],
});

async function handleMigrations() {
await Promise.all([setDefaultCadFeatures(), inactivityFilter()]);
await Promise.all([setDefaultCadFeatures()]);
}

try {
Expand Down
24 changes: 0 additions & 24 deletions apps/api/src/migrations/inactivity-filter.ts

This file was deleted.

12 changes: 6 additions & 6 deletions packages/schemas/src/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export const CAD_MISC_SETTINGS_SCHEMA = z.object({
authScreenBgImageId: z.any().or(z.string()).optional(),
authScreenHeaderImageId: z.any().or(z.string()).optional(),
inactivityTimeout: z.number().nullish(),
call911InactivityTimeout: z.number().gte(1).nullish(),
incidentInactivityTimeout: z.number().gte(1).nullish(),
unitInactivityTimeout: z.number().gte(1).nullish(),
activeDispatchersInactivityTimeout: z.number().gte(1).nullish(),
boloInactivityTimeout: z.number().gte(1).nullish(),
activeWarrantsInactivityTimeout: z.number().gte(1).nullish(),
call911InactivityTimeout: z.number().gte(10).nullish(),
incidentInactivityTimeout: z.number().gte(10).nullish(),
unitInactivityTimeout: z.number().gte(10).nullish(),
activeDispatchersInactivityTimeout: z.number().gte(10).nullish(),
boloInactivityTimeout: z.number().gte(10).nullish(),
activeWarrantsInactivityTimeout: z.number().gte(10).nullish(),
jailTimeScaling: z
.string()
.regex(/HOURS|MINUTES|SECONDS/)
Expand Down

0 comments on commit 7a20a81

Please sign in to comment.