fix: cleanupStuckedContainers
@@ -172,9 +172,9 @@ const host = '0.0.0.0';
|
|||||||
}, 60000 * 15);
|
}, 60000 * 15);
|
||||||
|
|
||||||
// Cleanup stucked containers (not defined in Coolify, but still running and managed by Coolify)
|
// Cleanup stucked containers (not defined in Coolify, but still running and managed by Coolify)
|
||||||
// setInterval(async () => {
|
setInterval(async () => {
|
||||||
// await cleanupStuckedContainers();
|
await cleanupStuckedContainers();
|
||||||
// }, 60000 * 5);
|
}, 2000);
|
||||||
|
|
||||||
// checkProxies, checkFluentBit & refresh templates
|
// checkProxies, checkFluentBit & refresh templates
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
@@ -344,9 +344,16 @@ async function cleanupStuckedContainers() {
|
|||||||
const containersArray = containers.trim().split('\n');
|
const containersArray = containers.trim().split('\n');
|
||||||
if (containersArray.length > 0) {
|
if (containersArray.length > 0) {
|
||||||
for (const container of containersArray) {
|
for (const container of containersArray) {
|
||||||
const application = await prisma.application.findFirst({ where: { id: container } });
|
const containerId = container.split('-')[0];
|
||||||
const service = await prisma.service.findFirst({ where: { id: container } });
|
const application = await prisma.application.findFirst({
|
||||||
const database = await prisma.database.findFirst({ where: { id: container } });
|
where: { id: { startsWith: containerId } }
|
||||||
|
});
|
||||||
|
const service = await prisma.service.findFirst({
|
||||||
|
where: { id: { startsWith: containerId } }
|
||||||
|
});
|
||||||
|
const database = await prisma.database.findFirst({
|
||||||
|
where: { id: { startsWith: containerId } }
|
||||||
|
});
|
||||||
if (!application && !service && !database) {
|
if (!application && !service && !database) {
|
||||||
await executeCommand({ command: `docker container rm -f ${container}` });
|
await executeCommand({ command: `docker container rm -f ${container}` });
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 486 B After Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 505 B |