mm_machine 3.0.6 → 3.0.7
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/manager.js +2 -20
- package/package.json +1 -1
package/manager.js
CHANGED
|
@@ -886,13 +886,7 @@ Manager.prototype._ensureAllLoaded = async function () {
|
|
|
886
886
|
var info = infos[i];
|
|
887
887
|
var t = Date.now();
|
|
888
888
|
promises.push(
|
|
889
|
-
this._ensureModLoaded(info.name)
|
|
890
|
-
return function (mod) {
|
|
891
|
-
if (mod) {
|
|
892
|
-
mod.log('info', '模块[' + m_name + '] _ensureModLoaded 耗时:' + (Date.now() - t0) + 'ms');
|
|
893
|
-
}
|
|
894
|
-
};
|
|
895
|
-
}(info.name, t))
|
|
889
|
+
this._ensureModLoaded(info.name)
|
|
896
890
|
);
|
|
897
891
|
}
|
|
898
892
|
await Promise.all(promises);
|
|
@@ -981,19 +975,7 @@ Manager.prototype.runAll = async function (method, ...params) {
|
|
|
981
975
|
let mod = this.getMod(info.name);
|
|
982
976
|
if (!mod) continue;
|
|
983
977
|
|
|
984
|
-
promises.push(
|
|
985
|
-
(function (m_name, m_method, m_mod) {
|
|
986
|
-
var t = Date.now();
|
|
987
|
-
return m_mod.do(m_method, ...params).then(function () {
|
|
988
|
-
// 只记录 load 方法的耗时,避免过多日志
|
|
989
|
-
if (m_method === 'load') {
|
|
990
|
-
m_mod.log('info', '模块[' + m_name + '].do(' + m_method + ') 耗时:' + (Date.now() - t) + 'ms');
|
|
991
|
-
}
|
|
992
|
-
}).catch(function (err) {
|
|
993
|
-
return null;
|
|
994
|
-
});
|
|
995
|
-
})(info.name, method, mod)
|
|
996
|
-
);
|
|
978
|
+
promises.push(mod.do(method, ...params));
|
|
997
979
|
}
|
|
998
980
|
|
|
999
981
|
return await Promise.all(promises);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_machine",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "A flexible Node.js plugin mechanism system for dynamic loading, management and execution of modules. Supports hot reload, lifecycle management, and modern JavaScript features.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|