diff --git a/Procfile b/Procfile index c4bfc1646..b4d090db3 100644 --- a/Procfile +++ b/Procfile @@ -2,4 +2,3 @@ release: ./scripts/release.sh web: ./scripts/heroku-node-settings.sh apps/backend/dist/processes/proc/web.js buildAndSynchronize: ./scripts/heroku-node-settings.sh apps/backend/dist/processes/proc/build-and-synchronize.js screenshotDiff: ./scripts/heroku-node-settings.sh apps/backend/dist/processes/proc/screenshot-diff.js -concludeBuilds: ./scripts/heroku-node-settings.sh apps/backend/dist/processes/proc/conclude-builds.js diff --git a/apps/backend/src/build/bin/queue-unconcluded-builds.ts b/apps/backend/src/build/bin/queue-unconcluded-builds.ts deleted file mode 100755 index c5826062a..000000000 --- a/apps/backend/src/build/bin/queue-unconcluded-builds.ts +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env node -import { callbackify } from "node:util"; - -import { Build } from "@/database/models/index.js"; -import logger from "@/logger/index.js"; - -import { concludeBuildsJob } from "../conclude-job"; - -const main = callbackify(async () => { - const batch = 500; - const totalCount = await Build.query() - .where("jobStatus", "complete") - .whereNull("conclusion") - .resultSize(); - - let total = 0; - for (let offset = 0; offset < totalCount; offset += batch) { - const nodes = await Build.query() - .where("jobStatus", "complete") - .whereNull("conclusion") - .limit(batch) - .offset(offset) - .orderBy("id", "desc"); - - const ids = nodes.map((node) => node.id); - const percentage = Math.round((total / totalCount) * 100); - logger.info( - `Processing ${total}/${totalCount} (${percentage}%) - Pushing ${ids.length} builds in queue`, - ); - await concludeBuildsJob.push(...ids); - total += nodes.length; - } - - logger.info(`${total} builds pushed in queue (100% complete)`); -}); - -main((err) => { - if (err) { - throw err; - } -}); diff --git a/apps/backend/src/build/conclude-job.ts b/apps/backend/src/build/conclude-job.ts deleted file mode 100644 index 8f8b25ae4..000000000 --- a/apps/backend/src/build/conclude-job.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { createJob } from "@/job-core/index.js"; -import logger from "@/logger/index.js"; - -import { concludeBuild } from "./concludeBuild.js"; - -export const concludeBuildsJob = createJob("conclude-builds", { - complete: () => {}, - error: (value, error) => { - console.error("Error while processing build", value, error); - }, - perform: async (buildId: string) => { - logger.info(`Concluding build ${buildId}`); - await concludeBuild({ buildId }); - logger.info(`Build ${buildId} concluded`); - }, -}); diff --git a/apps/backend/src/processes/proc/conclude-builds.ts b/apps/backend/src/processes/proc/conclude-builds.ts deleted file mode 100644 index fe8b154b4..000000000 --- a/apps/backend/src/processes/proc/conclude-builds.ts +++ /dev/null @@ -1,6 +0,0 @@ -import "../setup.js"; - -import { concludeBuildsJob } from "@/build/conclude-job.js"; -import { createJobWorker } from "@/job-core/index.js"; - -createJobWorker(concludeBuildsJob);