mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-08 23:45:22 +02:00
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:
@@ -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"]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user