Use new autoextend
This commit is contained in:
parent
63339eb686
commit
91b293fd49
|
@ -11,10 +11,6 @@ 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)
|
||||||
|
|
||||||
// TODO
|
|
||||||
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
|
||||||
console.log(`Processing app migration for "${appId}"`)
|
console.log(`Processing app migration for "${appId}"`)
|
||||||
|
@ -22,9 +18,9 @@ async function processMessage(job: Job) {
|
||||||
await locks.doWithLock(
|
await locks.doWithLock(
|
||||||
{
|
{
|
||||||
name: LockName.APP_MIGRATION,
|
name: LockName.APP_MIGRATION,
|
||||||
type: LockType.DEFAULT,
|
type: LockType.AUTO_EXTEND,
|
||||||
resource: appId,
|
resource: appId,
|
||||||
ttl: PROCESS_MIGRATION_TIMEOUT,
|
ttl: 60000,
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
await context.doInAppContext(appId, async () => {
|
await context.doInAppContext(appId, async () => {
|
||||||
|
|
Loading…
Reference in New Issue