mm_machine 1.9.8 → 2.0.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/demo/test1/index.js +1 -1
- package/index.js +6 -0
- package/item.js +3 -0
- package/package.json +1 -1
package/demo/test1/index.js
CHANGED
package/index.js
CHANGED
|
@@ -468,6 +468,9 @@ Index.prototype.run = async function(name, method, ...params) {
|
|
|
468
468
|
if (name) {
|
|
469
469
|
var o = await this.get(name);
|
|
470
470
|
if (o && o.config.state === 1) {
|
|
471
|
+
if (!o.complete) {
|
|
472
|
+
await o.exec('load');
|
|
473
|
+
}
|
|
471
474
|
var ret = o.exec(method, ...params);
|
|
472
475
|
if (util.types.isPromise(ret)) {
|
|
473
476
|
result = await ret;
|
|
@@ -483,6 +486,9 @@ Index.prototype.run = async function(name, method, ...params) {
|
|
|
483
486
|
for (var i = 0; i < lt.length; i++) {
|
|
484
487
|
var o = lt[i];
|
|
485
488
|
if (o.config.state === 1) {
|
|
489
|
+
if (!o.complete) {
|
|
490
|
+
await o.exec('load');
|
|
491
|
+
}
|
|
486
492
|
var ret = o.exec(method, ...params);
|
|
487
493
|
if (util.types.isPromise(ret)) {
|
|
488
494
|
result = await ret;
|
package/item.js
CHANGED
|
@@ -97,6 +97,9 @@ class Item {
|
|
|
97
97
|
* @param {Object} config 配置
|
|
98
98
|
*/
|
|
99
99
|
Item.prototype.set_config = function(config) {
|
|
100
|
+
if (config && config.func_file !== this.config.func_file) {
|
|
101
|
+
this.complete = false;
|
|
102
|
+
}
|
|
100
103
|
this.config = conf(Object.assign({}, this.config, config || {}), this.filename);
|
|
101
104
|
}
|
|
102
105
|
|