diff --git a/app/utils/runtimeCheckLogs.ts b/app/utils/runtimeCheckLogs.ts index ea87feb..eddb38d 100644 --- a/app/utils/runtimeCheckLogs.ts +++ b/app/utils/runtimeCheckLogs.ts @@ -72,7 +72,7 @@ export async function runtimeCheckLogs(folderPath) { const filePath = `${folderPath}/${fileName}`; const scan = fs.watchFile( filePath, - { interval: 5000 }, + { interval: 120000 }, async (eventType) => { //check special item, extra RAM, error in log let lines = []; @@ -143,7 +143,6 @@ export async function runtimeCheckLogs(folderPath) { .readFileSync(filePath) .toString() ?.split("\n"); - console.log(file) if (logsDetect[0].length > 10) { spoiler = spoiler + "```spoiler ..."+ (logsDetect[0].length - 5) +" more items\n" + content diff --git a/start/routes.ts b/start/routes.ts index 872c497..524fde3 100644 --- a/start/routes.ts +++ b/start/routes.ts @@ -48,6 +48,7 @@ Route.post("/api/account/checkLogin", "UsersController.checkLogin"); //Log Route.get("/api/log/showLog/:name?", async ({ request, response }) => { + try { const content = await axios.get( "http://192.168.5.7:8080/" + request.params().name ); @@ -103,6 +104,11 @@ Route.get("/api/log/showLog/:name?", async ({ request, response }) => { \ " ); + } catch (error) { + response.send( + "

-------------- File not found --------------

" + ); + } }); //Key-Value