ee-core 4.0.0 → 4.0.1

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.
@@ -10,6 +10,7 @@ const { getRandomString, getValueFromArgv } = require('../utils/helper');
10
10
  const { is } = require('../utils');
11
11
  const { parseArgv } = require('../utils/pargv');
12
12
  const { app: electronApp } = require('electron');
13
+ const tkill = require('tree-kill');
13
14
 
14
15
  class CrossProcess {
15
16
  constructor(host, opt = {}) {
@@ -116,11 +117,15 @@ class CrossProcess {
116
117
  * kill
117
118
  */
118
119
  kill(timeout = 1000) {
119
- this.child.kill('SIGINT');
120
- setTimeout(() => {
121
- if (this.child.killed) return;
122
- this.child.kill('SIGKILL');
123
- }, timeout)
120
+ tkill(this.pid, 'SIGINT', (err) => {
121
+ if (err) {
122
+ coreLogger.error(`[ee-core] [corss/process] kill cross-process, error: ${err}, pid:${this.pid}`);
123
+ tkill(this.pid, 'SIGKILL');
124
+ }
125
+ setTimeout(() => {
126
+ this._exitElectron();
127
+ }, timeout)
128
+ })
124
129
  }
125
130
 
126
131
  getUrl() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -33,6 +33,7 @@
33
33
  "serialize-javascript": "^6.0.1",
34
34
  "socket.io": "^4.6.1",
35
35
  "socket.io-client": "^4.6.1",
36
+ "tree-kill": "^1.2.2",
36
37
  "urllib": "^2.38.0"
37
38
  },
38
39
  "devDependencies": {