Merge pull request #3258 from Dokploy/fix/long-request-on-cleanup

Fix/long request on cleanup
This commit is contained in:
Mauricio Siu
2025-12-13 00:58:50 -06:00
committed by GitHub
3 changed files with 46 additions and 8 deletions

View File

@@ -173,7 +173,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
serverId: serverId,
})
.then(async () => {
toast.success("Cleaned all");
toast.success("Cleaning in progress... Please wait");
})
.catch(() => {
toast.error("Error cleaning all");

View File

@@ -3,6 +3,7 @@ import {
checkGPUStatus,
checkPortInUse,
cleanupAll,
cleanupAllBackground,
cleanupBuilders,
cleanupContainers,
cleanupImages,
@@ -193,9 +194,10 @@ export const settingsRouter = createTRPCRouter({
cleanAll: adminProcedure
.input(apiServerSchema)
.mutation(async ({ input }) => {
await cleanupAll(input?.serverId);
// Execute cleanup in background and return immediately to avoid gateway timeouts
const result = await cleanupAllBackground(input?.serverId);
return true;
return result;
}),
cleanMonitoring: adminProcedure.mutation(async () => {
if (IS_CLOUD) {