add log cache, routes, and controller

This commit is contained in:
Alex Holliday committed 2025-06-23 11:25:42 +08:00
1 parent 34485a0cae
commit 0b6febbb82
4 files changed
+93 -10

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { handleError } from "./controllerUtils.js";
const SERVICE_NAME = "JobQueueController";
class LogController {
constructor(logger) {
this.logger = logger;
}
getLogs = async (req, res, next) => {
try {
const logs = await this.logger.getLogs();
res.success({
msg: "Logs fetched successfully",
data: logs,
});
} catch (error) {
next(handleError(error, SERVICE_NAME, "getMetrics"));
return;
}
};
}
export default LogController;