aimedb: Defensively close connection after a Goodbye
We should probably also add request timeouts and such.
This commit is contained in:
+6
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user