feat(dashboard): add clean all deployment queue action

- Introduced a new action in the dashboard to clean the entire deployment queue, enhancing user control over deployment processes.
- Implemented error handling with toast notifications to inform users of the success or failure of the action.
- Updated the API to support the new clean all deployment queue functionality.
This commit is contained in:
Mauricio Siu
2026-02-07 01:53:52 -06:00
parent a1a348e22d
commit b741618251
3 changed files with 30 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import {
execAsyncRemote,
} from "@dokploy/server/utils/process/execAsync";
import { Queue } from "bullmq";
import { deploymentWorker } from "./deployments-queue";
import { redisConfig } from "./redis-connection";
const myQueue = new Queue("deployments", {
@@ -34,6 +35,11 @@ export const cleanQueuesByApplication = async (applicationId: string) => {
}
};
export const cleanAllDeploymentQueue = async () => {
deploymentWorker.cancelAllJobs("User requested cancellation");
return true;
};
export const cleanQueuesByCompose = async (composeId: string) => {
const jobs = await myQueue.getJobs(["waiting", "delayed"]);