diff --git a/apps/api/prisma/migrations/20241027124904_/migration.sql b/apps/api/prisma/migrations/20241027124904_/migration.sql new file mode 100644 index 0000000..339f86b --- /dev/null +++ b/apps/api/prisma/migrations/20241027124904_/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Server" ADD COLUMN "isDormant" BOOLEAN NOT NULL DEFAULT false; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 4ba67b2..b6a8691 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -16,6 +16,7 @@ model Server { baseUrl String morgueUrl String? logfile Logfile[] + isDormant Boolean @default(false) } model Logfile { diff --git a/apps/api/prisma/seed.ts b/apps/api/prisma/seed.ts index bfa421d..6a06baa 100644 --- a/apps/api/prisma/seed.ts +++ b/apps/api/prisma/seed.ts @@ -11,6 +11,7 @@ async function main() { url: server.url, baseUrl: server.baseUrl, morgueUrl: server.morgueUrl, + isDormant: 'isDormant' in server ? server.isDormant : false, } const s = await prisma.server.upsert({ create: data, diff --git a/apps/api/prisma/seedData.ts b/apps/api/prisma/seedData.ts index e641e65..cd8c8a2 100644 --- a/apps/api/prisma/seedData.ts +++ b/apps/api/prisma/seedData.ts @@ -337,6 +337,7 @@ export const data = { url: 'http://webzook.net:8080', baseUrl: 'https://webzook.net', morgueUrl: 'http://webzook.net/soup/morgue', + isDormant: true, logfiles: [ ...range(13, 32).map((version) => ({ path: `/soup/0.${version}/logfile`, diff --git a/apps/api/src/parser/loader.ts b/apps/api/src/parser/loader.ts index 75ab2bb..7c1fa79 100644 --- a/apps/api/src/parser/loader.ts +++ b/apps/api/src/parser/loader.ts @@ -65,7 +65,10 @@ export const startFetchQueue = async () => { }) const main = async () => { - const logfiles = await prisma.logfile.findMany({ include: { server: true } }) + const logfiles = await prisma.logfile.findMany({ + where: { server: { isDormant: false } }, + include: { server: true }, + }) for (const file of shuffle(logfiles)) { queue.add(() =>