ee-core 4.0.1 → 4.1.0

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.
package/jobs/child/app.js CHANGED
@@ -47,15 +47,20 @@ class ChildApp {
47
47
  const {jobPath, jobParams, jobFunc, jobFuncParams} = msg;
48
48
  let mod = requireFile(jobPath);
49
49
  if (is.class(mod) || isBytecodeClass(mod)) {
50
+ let instance;
50
51
  if (!this.jobMap.has(jobPath)) {
51
- const instance = new mod(...jobParams);
52
- instance.handle(...jobParams);
52
+ instance = new mod(...jobParams);
53
53
  this.jobMap.set(jobPath, instance);
54
54
  } else {
55
- const instance = this.jobMap.get(jobPath);
56
- instance[jobFunc](...jobFuncParams);
55
+ instance = this.jobMap.get(jobPath);
57
56
  }
58
57
 
58
+ // 如果指定了函数名,则调用指定的函数
59
+ if (jobFunc) {
60
+ instance[jobFunc](...jobFuncParams);
61
+ } else {
62
+ instance.handle(...jobParams);
63
+ }
59
64
  } else if (is.function(mod)) {
60
65
  mod(jobParams);
61
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {