mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-26 09:35:29 +02:00
refactor(multi-server): replace executeCommand with execAsyncRemote
This commit is contained in:
@@ -1,24 +1,8 @@
|
||||
import { type ConnectionOptions, type Job, Queue, Worker } from "bullmq";
|
||||
import { findServerById, type Server } from "../api/services/server";
|
||||
import type { DeploymentJob } from "./deployments-queue";
|
||||
import {
|
||||
deployApplication,
|
||||
rebuildApplication,
|
||||
updateApplicationStatus,
|
||||
} from "../api/services/application";
|
||||
import {
|
||||
updateCompose,
|
||||
deployCompose,
|
||||
rebuildCompose,
|
||||
} from "../api/services/compose";
|
||||
import { type ConnectionOptions, Queue } from "bullmq";
|
||||
|
||||
export const redisConfig: ConnectionOptions = {
|
||||
// host: "31.220.108.27",
|
||||
// password: "xYBugfHkULig1iLN",
|
||||
host: process.env.NODE_ENV === "production" ? "dokploy-redis" : "127.0.0.1",
|
||||
// port: 1233,
|
||||
};
|
||||
// TODO: maybe add a options to clean the queue to the times
|
||||
const myQueue = new Queue("deployments", {
|
||||
connection: redisConfig,
|
||||
});
|
||||
@@ -38,13 +22,3 @@ myQueue.on("error", (error) => {
|
||||
});
|
||||
|
||||
export { myQueue };
|
||||
|
||||
const workersMap = new Map<string, Worker>();
|
||||
const queuesMap = new Map<string, Queue>();
|
||||
|
||||
function createRedisConnection(server: Server) {
|
||||
return {
|
||||
host: server.ipAddress,
|
||||
port: "6379",
|
||||
} as ConnectionOptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user