1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

Use new autoextend

This commit is contained in:
Adria Navarro 2023-11-30 12:22:05 +01:00
parent 63339eb686
commit 91b293fd49

View file

@ -11,10 +11,6 @@ import environment from "../environment"
const appMigrationQueue = queue.createQueue(queue.JobQueue.APP_MIGRATION)
appMigrationQueue.process(processMessage)
// TODO
export const PROCESS_MIGRATION_TIMEOUT =
environment.APP_MIGRATION_TIMEOUT || 60000
async function processMessage(job: Job) {
const { appId } = job.data
console.log(`Processing app migration for "${appId}"`)
@ -22,9 +18,9 @@ async function processMessage(job: Job) {
await locks.doWithLock(
{
name: LockName.APP_MIGRATION,
type: LockType.DEFAULT,
type: LockType.AUTO_EXTEND,
resource: appId,
ttl: PROCESS_MIGRATION_TIMEOUT,
ttl: 60000,
},
async () => {
await context.doInAppContext(appId, async () => {