2024-10-15 11:57:37 +08:00
|
|
|
import { Router } from "express";
|
2024-06-05 12:29:01 -07:00
|
|
|
|
2024-12-24 11:58:56 -08:00
|
|
|
class QueueRoutes {
|
|
|
|
|
constructor(queueController) {
|
|
|
|
|
this.router = Router();
|
|
|
|
|
this.queueController = queueController;
|
|
|
|
|
this.initRoutes();
|
|
|
|
|
}
|
|
|
|
|
initRoutes() {
|
|
|
|
|
this.router.get("/metrics", this.queueController.getMetrics);
|
|
|
|
|
this.router.get("/jobs", this.queueController.getJobs);
|
|
|
|
|
this.router.post("/jobs", this.queueController.addJob);
|
|
|
|
|
this.router.post("/obliterate", this.queueController.obliterateQueue);
|
|
|
|
|
}
|
2024-08-15 14:13:12 -07:00
|
|
|
|
2024-12-24 11:58:56 -08:00
|
|
|
getRouter() {
|
|
|
|
|
return this.router;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-05 12:29:01 -07:00
|
|
|
|
2024-12-24 11:58:56 -08:00
|
|
|
export default QueueRoutes;
|