1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-28 04:04:58 +03:00

fix(server): close error log file handler

This commit is contained in:
louistiti 2023-04-26 21:31:12 +08:00
parent 9a66b677e0
commit 0947bd7877

View File

@ -90,7 +90,9 @@ export class LogHelper {
*/
public static async parseErrorLogs(): Promise<string[]> {
if (!fs.existsSync(LogHelper.ERRORS_FILE_PATH)) {
await fs.promises.open(LogHelper.ERRORS_FILE_PATH, 'w')
const fileHandle = await fs.promises.open(LogHelper.ERRORS_FILE_PATH, 'w')
await fileHandle.close()
}
const errorFileContent = await fs.promises.readFile(