diff --git a/src/aimedb/index.ts b/src/aimedb/index.ts index 8aa6c5c..8243834 100644 --- a/src/aimedb/index.ts +++ b/src/aimedb/index.ts @@ -19,9 +19,13 @@ export default async function aimedb(socket: Socket) { const req = obj as AimeRequest; const res = await dispatch(txn, req, now); - if (res !== undefined) { - output.write(res); + if (res === undefined) { + console.log("Aimedb: Closing connection"); + + break; } + + output.write(res); } await txn.commit();