From c137b11abfb946ef72a5fcb27e11e0b286a33be3 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Sat, 6 Jun 2020 04:39:49 +0100 Subject: fix: revert setInterval log flushing as it prevents process completion (#6127) --- std/log/handlers.ts | 5 ----- 1 file changed, 5 deletions(-) (limited to 'std/log/handlers.ts') diff --git a/std/log/handlers.ts b/std/log/handlers.ts index b7a8c9cae..5e72ff582 100644 --- a/std/log/handlers.ts +++ b/std/log/handlers.ts @@ -106,7 +106,6 @@ export class FileHandler extends WriterHandler { protected _mode: LogMode; protected _openOptions: OpenOptions; protected _encoder = new TextEncoder(); - #intervalId = -1; #unloadCallback = (): Promise => this.destroy(); constructor(levelName: LevelName, options: FileHandlerOptions) { @@ -129,9 +128,6 @@ export class FileHandler extends WriterHandler { this._buf = new BufWriterSync(this._file); addEventListener("unload", this.#unloadCallback); - - // flush the buffer every 30 seconds - this.#intervalId = setInterval(() => this.flush(), 30 * 1000); } handle(logRecord: LogRecord): void { @@ -158,7 +154,6 @@ export class FileHandler extends WriterHandler { this._file?.close(); this._file = undefined; removeEventListener("unload", this.#unloadCallback); - clearInterval(this.#intervalId); return Promise.resolve(); } } -- cgit v1.2.3