chore: clean up unused variables and improve error handling across codebase

This commit focuses on removing unused variables, adding placeholder error handling, and generally tidying up various files across the Dokploy application. Changes include:

- Removing unused imports and variables
- Adding placeholder error handling in catch blocks
- Cleaning up commented-out code
- Removing deprecated utility files
- Improving type safety and code consistency
This commit is contained in:
Mauricio Siu
2025-02-22 20:35:21 -06:00
parent 1a415b96c9
commit 8ab6d6b282
132 changed files with 375 additions and 471 deletions

View File

@@ -66,7 +66,7 @@ export const setupMonitoring = async (serverId: string) => {
await container.inspect();
await container.remove({ force: true });
console.log("Removed existing container");
} catch (error) {
} catch (_error) {
// Container doesn't exist, continue
}
@@ -135,7 +135,7 @@ export const setupWebMonitoring = async (userId: string) => {
await container.inspect();
await container.remove({ force: true });
console.log("Removed existing container");
} catch (error) {}
} catch (_error) {}
await docker.createContainer(settings);
const newContainer = docker.getContainer(containerName);

View File

@@ -56,7 +56,7 @@ export const initializePostgres = async () => {
});
console.log("Postgres Started ✅");
} catch (error) {
} catch (_error) {
await docker.createService(settings);
console.log("Postgres Not Found: Starting ✅");
}

View File

@@ -52,7 +52,7 @@ export const initializeRedis = async () => {
...settings,
});
console.log("Redis Started ✅");
} catch (error) {
} catch (_error) {
await docker.createService(settings);
console.log("Redis Not Found: Starting ✅");
}

View File

@@ -89,7 +89,7 @@ export const serverAudit = async (serverId: string) => {
.on("data", (data: string) => {
output += data;
})
.stderr.on("data", (data) => {});
.stderr.on("data", (_data) => {});
});
})
.on("error", (err) => {

View File

@@ -128,7 +128,7 @@ export const serverValidate = async (serverId: string) => {
.on("data", (data: string) => {
output += data;
})
.stderr.on("data", (data) => {});
.stderr.on("data", (_data) => {});
});
})
.on("error", (err) => {

View File

@@ -18,7 +18,7 @@ export const dockerSwarmInitialized = async () => {
await docker.swarmInspect();
return true;
} catch (e) {
} catch (_e) {
return false;
}
};
@@ -41,7 +41,7 @@ export const dockerNetworkInitialized = async () => {
try {
await docker.getNetwork("dokploy-network").inspect();
return true;
} catch (e) {
} catch (_e) {
return false;
}
};

View File

@@ -127,7 +127,7 @@ export const initializeTraefik = async ({
});
console.log("Traefik Started ✅");
} catch (error) {
} catch (_error) {
await docker.createService(settings);
console.log("Traefik Not Found: Starting ✅");
}