From 72fabd4dacb8c82b6f0b48df943d92a69170538f Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Thu, 30 Jul 2020 11:59:25 +0200 Subject: [PATCH 1/2] LDAP server: close on application stop --- src/LDAPServerComponent.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/LDAPServerComponent.ts b/src/LDAPServerComponent.ts index 6c5e3bf..b5f9e45 100644 --- a/src/LDAPServerComponent.ts +++ b/src/LDAPServerComponent.ts @@ -57,5 +57,22 @@ export default class LDAPServerComponent extends ApplicationComponent { this.server.listen(8389, '127.0.0.1', () => { Logger.info(`LDAP server listening on ${this.server!.url}`); }); + this.server.on('close', () => { + Logger.info('LDAP server closed.'); + }); + } + + + public async stop(): Promise { + await new Promise(resolve => { + if (this.server) { + // @ts-ignore + this.server.close(() => { + resolve(); + }); + } else { + resolve(); + } + }); } } \ No newline at end of file From 471c5edaa6713c7bdf269efba6e27ee632eaf1d5 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Thu, 30 Jul 2020 11:59:45 +0200 Subject: [PATCH 2/2] Version 1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d78558..3ce5607 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aldap", - "version": "1.1.0", + "version": "1.1.1", "description": "Authentication LDAP server", "repository": "git@gitlab.com:ArisuOngaku/aldap.git", "author": "Alice Gaudon ",