mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-09 16:05:23 +02:00
feat(cleanup): implement background cleanup functionality
- Added a new `cleanupAllBackground` function to execute Docker cleanup commands in the background, allowing for immediate return and avoiding gateway timeouts. - Refactored existing cleanup functions to utilize a centralized `cleanupCommands` object for better maintainability and readability.
This commit is contained in:
@@ -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