mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-18 13:45:23 +02:00
refactor: remove unused mount-related logic from postgres router
- Removed the findMountsByApplicationId and updateMount functions from the postgres router as they are no longer needed after the recent refactor of the getMountPath function. - Cleaned up the code to streamline the update process for PostgreSQL instances.
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
deployPostgres,
|
||||
findBackupsByDbId,
|
||||
findEnvironmentById,
|
||||
findMountsByApplicationId,
|
||||
findPostgresById,
|
||||
findProjectById,
|
||||
getMountPath,
|
||||
@@ -18,7 +17,6 @@ import {
|
||||
startServiceRemote,
|
||||
stopService,
|
||||
stopServiceRemote,
|
||||
updateMount,
|
||||
updatePostgresById,
|
||||
} from "@dokploy/server";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
@@ -370,24 +368,6 @@ export const postgresRouter = createTRPCRouter({
|
||||
});
|
||||
}
|
||||
|
||||
if (rest.dockerImage) {
|
||||
const mountPath = getMountPath(rest.dockerImage);
|
||||
const mounts = await findMountsByApplicationId(postgresId, "postgres");
|
||||
if (!mounts || mounts.length === 0) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
message: "Mount not found for this Postgres",
|
||||
});
|
||||
}
|
||||
for (const mount of mounts) {
|
||||
if (mount.mountPath.startsWith("/var/lib/postgresql")) {
|
||||
await updateMount(mount.mountId, {
|
||||
mountPath: mountPath,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const service = await updatePostgresById(postgresId, {
|
||||
...rest,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user