Skip to content

Commit

Permalink
fix timeout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Sep 15, 2023
1 parent 63c8d5c commit 9ed6d7a
Showing 1 changed file with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,28 @@ export const job20230911_migrate_alert_messages = {

// fs.writeFileSync(path.resolve(__dirname, '___translations.json'), JSON.stringify(translation))

await prisma.$transaction(async (tx) => {
const tkeys = await tx.translationKey.createMany({ data: translationKey, skipDuplicates: true })
log(`Translation keys created: ${tkeys.count}`)

const fText = await tx.freeText.createMany({ data: freeText, skipDuplicates: true })
log(`FreeText records created: ${fText.count}`)

const oAtt = await tx.organizationAttribute.createMany({
data: organizationAttribute,
skipDuplicates: true,
})
log(`Organization Attribute records created: ${oAtt.count}`)

const aSupp = await tx.attributeSupplement.createMany({
data: attributeSupplement,
skipDuplicates: true,
})
log(`Attribute Supplement records created: ${aSupp.count}`)
})
await prisma.$transaction(
async (tx) => {
const tkeys = await tx.translationKey.createMany({ data: translationKey, skipDuplicates: true })
log(`Translation keys created: ${tkeys.count}`)

const fText = await tx.freeText.createMany({ data: freeText, skipDuplicates: true })
log(`FreeText records created: ${fText.count}`)

const oAtt = await tx.organizationAttribute.createMany({
data: organizationAttribute,
skipDuplicates: true,
})
log(`Organization Attribute records created: ${oAtt.count}`)

const aSupp = await tx.attributeSupplement.createMany({
data: attributeSupplement,
skipDuplicates: true,
})
log(`Attribute Supplement records created: ${aSupp.count}`)
},
{ timeout: 60000 }
)

/**
* DO NOT REMOVE BELOW
Expand Down

0 comments on commit 9ed6d7a

Please sign in to comment.