fix: timeout in some case
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s

This commit is contained in:
Methapon2001 2025-09-16 11:52:13 +07:00
parent 0772e4710a
commit 158a6ff163

View file

@ -62,7 +62,8 @@ export async function initThailandAreaDatabase() {
return result;
}
await prisma.$transaction(async (tx) => {
await prisma.$transaction(
async (tx) => {
const meta = {
createdBy: null,
createdAt: new Date(),
@ -140,7 +141,11 @@ export async function initThailandAreaDatabase() {
.execute();
}),
);
});
},
{
timeout: 15_000,
},
);
console.log("[INFO]: Sync thailand province, district and subdistrict, OK.");
}
@ -170,7 +175,8 @@ export async function initEmploymentOffice() {
const list = await prisma.province.findMany();
await prisma.$transaction(async (tx) => {
await prisma.$transaction(
async (tx) => {
await Promise.all(
list
.map(async (province) => {
@ -230,7 +236,11 @@ export async function initEmploymentOffice() {
})
.flat(),
);
});
},
{
timeout: 15_000,
},
);
console.log("[INFO]: Sync employment office, OK.");
}