mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-25 20:52:10 +00:00
fix: cleanup stucked prisma-engines
This commit is contained in:
16
apps/api/src/jobs/cleanupPrismaEngines.ts
Normal file
16
apps/api/src/jobs/cleanupPrismaEngines.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { parentPort } from 'node:worker_threads';
|
||||
import { asyncExecShell, isDev, prisma } from '../lib/common';
|
||||
|
||||
(async () => {
|
||||
if (parentPort) {
|
||||
if (!isDev) {
|
||||
try {
|
||||
await asyncExecShell(`killall -q -e /app/prisma-engines/query-engine -o 10m`)
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
} else process.exit(0);
|
||||
})();
|
||||
Reference in New Issue
Block a user