fix(core): update

This commit is contained in:
Philipp Kunz 2020-07-26 14:01:17 +00:00
parent 3e0d01520e
commit a69fee7985

View File

@ -6,14 +6,17 @@ export class AgTestServer {
constructor(handlerArg?: plugins.agSdk.AAgHandler<any>) { constructor(handlerArg?: plugins.agSdk.AAgHandler<any>) {
if (handlerArg) { if (handlerArg) {
this.handlers.push(handlerArg); this.addAgHandler(handlerArg);
} }
} }
public async addAgHandler(handlerArg: plugins.agSdk.AAgHandler<any>) { public async addAgHandler(handlerArg: plugins.agSdk.AAgHandler<any>) {
this.handlers.push(handlerArg); this.handlers.push(handlerArg);
await this.stop(); console.log(`added handler with slug ${handlerArg.slug}`);
await this.start(); if (this.server && this.server.serverStatus === 'running') {
await this.stop();
await this.start();
}
} }
public async start() { public async start() {