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 }