fix: cleanup prisma engine if there is more than 1
This commit is contained in:
parent
ddd09412cd
commit
5d5a478cd1
@ -5,7 +5,10 @@ import { asyncExecShell, isDev, prisma } from '../lib/common';
|
|||||||
if (parentPort) {
|
if (parentPort) {
|
||||||
if (!isDev) {
|
if (!isDev) {
|
||||||
try {
|
try {
|
||||||
await asyncExecShell(`killall -q -e /app/prisma-engines/query-engine -o 10m`)
|
const { stdout } = await asyncExecShell(`ps -ef | grep /app/prisma-engines/query-engine | grep -v grep | wc -l | xargs`)
|
||||||
|
if (stdout.trim() != null && stdout.trim() != '' && Number(stdout.trim()) > 1) {
|
||||||
|
await asyncExecShell(`killall -q -e /app/prisma-engines/query-engine -o 10m`)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -37,6 +37,7 @@ const options: any = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cleanupPrismaEngines',
|
name: 'cleanupPrismaEngines',
|
||||||
|
interval: '1m'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'checkProxies',
|
name: 'checkProxies',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user