@aloma.io/integration-sdk 3.3.49 → 3.3.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,5 +60,11 @@ export default class RuntimeContext {
60
60
  }
61
61
  });
62
62
  connector.run();
63
+ const term = async () => {
64
+ await controller._doStop();
65
+ process.exit(0);
66
+ };
67
+ process.on("SIGTERM", term);
68
+ process.on("SIGINT", term);
63
69
  }
64
70
  }
@@ -2,7 +2,7 @@ export declare abstract class AbstractController {
2
2
  protected config: any;
3
3
  protected client: any;
4
4
  protected start(): Promise<void>;
5
- protected stop(): Promise<void>;
5
+ protected stop(isShutdown?: boolean): Promise<void>;
6
6
  protected configQuery(arg: any): Promise<any>;
7
7
  protected fallback(arg: any): Promise<any>;
8
8
  protected endpoint(arg: any): Promise<any>;
@@ -16,5 +16,5 @@ export declare abstract class AbstractController {
16
16
  __configQuery(arg: any): Promise<any | null>;
17
17
  __default(arg: any): Promise<any | null>;
18
18
  _doStart(config: any, client: any, newTask: any, updateTask: any, getClient: any): Promise<void>;
19
- _doStop(): Promise<void>;
19
+ _doStop(isShutdown?: boolean): Promise<void>;
20
20
  }
@@ -2,7 +2,7 @@ export class AbstractController {
2
2
  config;
3
3
  client;
4
4
  async start() { }
5
- async stop() { }
5
+ async stop(isShutdown = false) { }
6
6
  configQuery(arg) {
7
7
  return Promise.resolve({});
8
8
  }
@@ -38,7 +38,7 @@ export class AbstractController {
38
38
  this.getClient = getClient;
39
39
  await this.start();
40
40
  }
41
- async _doStop() {
42
- await this.stop();
41
+ async _doStop(isShutdown = false) {
42
+ await this.stop(isShutdown);
43
43
  }
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.49",
3
+ "version": "3.3.51",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -81,5 +81,14 @@ export default class RuntimeContext {
81
81
  );
82
82
 
83
83
  connector.run();
84
+
85
+ const term = async () => {
86
+ await controller._doStop();
87
+
88
+ process.exit(0);
89
+ };
90
+
91
+ process.on("SIGTERM", term);
92
+ process.on("SIGINT", term);
84
93
  }
85
94
  }
@@ -4,7 +4,7 @@ export abstract class AbstractController {
4
4
 
5
5
  protected async start(): Promise<void> {}
6
6
 
7
- protected async stop(): Promise<void> {}
7
+ protected async stop(isShutdown: boolean = false): Promise<void> {}
8
8
 
9
9
  protected configQuery(arg: any): Promise<any> {
10
10
  return Promise.resolve({});
@@ -58,7 +58,7 @@ export abstract class AbstractController {
58
58
  await this.start();
59
59
  }
60
60
 
61
- async _doStop(): Promise<void> {
62
- await this.stop();
61
+ async _doStop(isShutdown: boolean = false): Promise<void> {
62
+ await this.stop(isShutdown);
63
63
  }
64
64
  }