diff --git a/start/routes.ts b/start/routes.ts index 6be8ea8..417b298 100644 --- a/start/routes.ts +++ b/start/routes.ts @@ -300,18 +300,18 @@ Route.post("/api/sendMailInforDevice", async () => { "writeLog" ); -// Route.post("/api/test", async () => { -// try { -// const logs = await Cache.get('logs') +Route.post("/api/test", async () => { + try { + const logs = await Cache.get('logs') -// if(logs){ -// return {type: "cache", data: logs} -// }else{ -// let data = await LogReport.all(); -// Cache.set('logs', data, 120) -// return {type: "no cache", data: data} -// } -// } catch (error) { -// console.log(error) -// } -// }) \ No newline at end of file + if(logs){ + return {type: "cache", data: logs} + }else{ + let data = await LogReport.all(); + Cache.set('logs', data, 120) + return {type: "no cache", data: data} + } + } catch (error) { + console.log(error) + } +}) \ No newline at end of file