mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-23 13:32:19 +00:00
Merge pull request #3258 from Dokploy/fix/long-request-on-cleanup
Fix/long request on cleanup
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user