test redis
This commit is contained in:
parent
f4ec11f55e
commit
33b850875e
|
|
@ -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)
|
||||
// }
|
||||
// })
|
||||
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)
|
||||
}
|
||||
})
|
||||
Loading…
Reference in New Issue