remove unused route
This commit is contained in:
1 parent
76f550843b
commit
61cc0c2bef
3 files changed
+4
-17
No files matched your search
@@ -1,11 +1,12 @@
|
||||
import { ISuperSimpleQueue } from "@/service/index.js";
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
|
||||
const SERVICE_NAME = "JobQueueController";
|
||||
|
||||
class JobQueueController {
|
||||
static SERVICE_NAME = SERVICE_NAME;
|
||||
private jobQueue: any;
|
||||
constructor(jobQueue: any) {
|
||||
private jobQueue: ISuperSimpleQueue;
|
||||
constructor(jobQueue: ISuperSimpleQueue) {
|
||||
this.jobQueue = jobQueue;
|
||||
}
|
||||
|
||||
@@ -77,18 +78,5 @@ class JobQueueController {
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
checkQueueHealth = async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const stuckQueues = await this.jobQueue.checkQueueHealth();
|
||||
return res.status(200).json({
|
||||
success: true,
|
||||
msg: "Queue health checked successfully",
|
||||
data: stuckQueues,
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
}
|
||||
export default JobQueueController;
|
||||
@@ -14,7 +14,6 @@ class QueueRoutes {
|
||||
this.router.post("/jobs", isAllowed(["admin", "superadmin"]), this.queueController.addJob);
|
||||
|
||||
this.router.get("/metrics", isAllowed(["admin", "superadmin"]), this.queueController.getMetrics);
|
||||
this.router.get("/health", isAllowed(["admin", "superadmin"]), this.queueController.checkQueueHealth);
|
||||
this.router.get("/all-metrics", isAllowed(["admin", "superadmin"]), this.queueController.getAllMetrics);
|
||||
this.router.post("/flush", isAllowed(["admin", "superadmin"]), this.queueController.flushQueue);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ type QueueJobSummary = {
|
||||
export interface ISuperSimpleQueue {
|
||||
readonly serviceName: string;
|
||||
init(): Promise<boolean>;
|
||||
addJob(monitorId: string, monitor: Monitor): Promise<void>;
|
||||
addJob(monitorId: string, monitor?: Monitor): Promise<void>;
|
||||
deleteJob(monitor: Monitor): Promise<void>;
|
||||
pauseJob(monitor: Monitor): Promise<void>;
|
||||
resumeJob(monitor: Monitor): Promise<void>;
|
||||
|
||||
Reference in new issue
Block a user