Allow custom timeout

This commit is contained in:
Adria Navarro 2023-11-29 11:26:41 +01:00
parent 25c16ae229
commit 98702798fb
2 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import {
getAppMigrationMetadata, getAppMigrationMetadata,
updateAppMigrationMetadata, updateAppMigrationMetadata,
} from "./appMigrationMetadata" } from "./appMigrationMetadata"
import environment from "../environment"
const appMigrationQueue = queue.createQueue(queue.JobQueue.APP_MIGRATION) const appMigrationQueue = queue.createQueue(queue.JobQueue.APP_MIGRATION)
appMigrationQueue.process(processMessage) appMigrationQueue.process(processMessage)
@ -15,7 +16,8 @@ export async function runMigration(migrationId: string) {
} }
// TODO // TODO
export const PROCESS_MIGRATION_TIMEOUT = 30000 export const PROCESS_MIGRATION_TIMEOUT =
environment.APP_MIGRATION_TIMEOUT || 60000
async function processMessage(job: Job) { async function processMessage(job: Job) {
const { appId } = job.data const { appId } = job.data

View File

@ -87,6 +87,7 @@ const environment = {
}, },
TOP_LEVEL_PATH: TOP_LEVEL_PATH:
process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH, process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH,
APP_MIGRATION_TIMEOUT: parseIntSafe(process.env.APP_MIGRATION_TIMEOUT),
} }
// threading can cause memory issues with node-ts in development // threading can cause memory issues with node-ts in development