From 450b7944d729c237dd79cc7683c2a0b3d0997a2c Mon Sep 17 00:00:00 2001 From: Ale Figueroa Date: Tue, 5 Mar 2019 17:10:34 -0600 Subject: [PATCH] Remove close --- src/util.ts | 1 - src/yaktime.ts | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/util.ts b/src/util.ts index 92986d7..3442981 100644 --- a/src/util.ts +++ b/src/util.ts @@ -50,7 +50,6 @@ export interface YakTimeOpts { export interface YakTimeServer { (request: IncomingMessage, response: ServerResponse): void hits?: Set - close? (): Promise } export function ensureIsValidStatusCode (res: IncomingMessage, opts: YakTimeOpts) { diff --git a/src/yaktime.ts b/src/yaktime.ts index 055ed89..a5c4721 100644 --- a/src/yaktime.ts +++ b/src/yaktime.ts @@ -43,19 +43,6 @@ export function yaktime (host: string, opts: YakTimeOpts): YakTimeServer { } yaktimeTape.hits = hits - yaktimeTape.close = async () => { - const db = await recorder.db - - await new Promise(resolve => { - db.close(resolve) - }) - await new Promise(resolve => { - db.saveDatabase(resolve) - }) - - return new Promise(resolve => { - recorder.proxy.close(resolve) - }) - } + return yaktimeTape }