aimedb: Defensively close connection after a Goodbye

We should probably also add request timeouts and such.
This commit is contained in:
Tau
2019-11-06 17:28:30 -05:00
parent 3fea2dae56
commit 4298810728
+6 -2
View File
@@ -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();