alemonjs 2.1.89 → 2.1.91
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/bin/README.md +8 -1
- package/bin/alemonc.js +1 -2
- package/bin/publish.js +58 -23
- package/lib/application/runtime/cbp/connects/client.js +11 -1
- package/lib/application/runtime/client-runtime.d.ts +2 -0
- package/lib/application/runtime/client-runtime.js +14 -36
- package/lib/application/runtime/load-modules/load.d.ts +2 -2
- package/lib/application/runtime/load-modules/load.js +8 -8
- package/lib/application/runtime/load-modules/loadChild.d.ts +1 -1
- package/lib/application/runtime/load-modules/loadChild.js +3 -3
- package/lib/client.d.ts +1 -1
- package/lib/client.js +91 -1
- package/lib/core/index.d.ts +3 -0
- package/lib/core/index.js +2 -0
- package/lib/core/process/index.d.ts +1 -0
- package/lib/core/process/index.js +2 -2
- package/lib/core/process/ipc-bridge.js +12 -0
- package/lib/core/process/module.d.ts +3 -0
- package/lib/core/process/module.js +340 -101
- package/lib/core/process/platform.d.ts +3 -0
- package/lib/core/process/platform.js +393 -165
- package/lib/core/process/types.d.ts +22 -0
- package/lib/core/process/types.js +1 -0
- package/lib/global.d.ts +3 -0
- package/lib/index.js +2 -0
- package/lib/main.d.ts +1 -0
- package/lib/main.js +2 -0
- package/lib/platform/cbp-platform.js +11 -1
- package/lib/platform/define-platform.js +3 -0
- package/lib/platform-bootstrap.d.ts +1 -0
- package/lib/platform-bootstrap.js +85 -0
- package/package.json +1 -1
|
@@ -17,16 +17,276 @@ import { setClientChild, forwardFromClient } from './ipc-bridge.js';
|
|
|
17
17
|
const initRequire = () => { };
|
|
18
18
|
initRequire.resolve = () => '';
|
|
19
19
|
const require$1 = module$1?.createRequire?.(import.meta.url) ?? initRequire;
|
|
20
|
-
|
|
20
|
+
const createInitialState = () => ({
|
|
21
|
+
phase: 'idle',
|
|
22
|
+
protocolVersion: 'legacy',
|
|
23
|
+
transportMode: 'unknown',
|
|
24
|
+
restartCount: 0,
|
|
25
|
+
consecutiveFailures: 0,
|
|
26
|
+
legacyReadyMode: false,
|
|
27
|
+
bootTimings: {},
|
|
28
|
+
lastError: null
|
|
29
|
+
});
|
|
30
|
+
let moduleManager = null;
|
|
31
|
+
let moduleState = createInitialState();
|
|
32
|
+
let moduleProcessConfig = null;
|
|
33
|
+
let moduleProcessPath = '';
|
|
34
|
+
const isDebugEnabled = () => process.env.NODE_ENV === 'development';
|
|
35
|
+
const debugLog = (message, data = {}) => {
|
|
36
|
+
if (!isDebugEnabled()) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
logger.debug?.({
|
|
40
|
+
message,
|
|
41
|
+
data
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const normalizeErrorMessage = (error) => {
|
|
45
|
+
if (error instanceof Error) {
|
|
46
|
+
return error.message;
|
|
47
|
+
}
|
|
48
|
+
return typeof error === 'string' ? error : 'Unknown process adapter error';
|
|
49
|
+
};
|
|
50
|
+
const clearTimer = (timer) => {
|
|
51
|
+
if (timer) {
|
|
52
|
+
clearTimeout(timer);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const clearManagerTimers = (manager) => {
|
|
56
|
+
clearTimer(manager?.controlTimer);
|
|
57
|
+
clearTimer(manager?.transportTimer);
|
|
58
|
+
clearTimer(manager?.appTimer);
|
|
59
|
+
clearTimer(manager?.legacyTransportTimer);
|
|
60
|
+
if (manager) {
|
|
61
|
+
manager.controlTimer = undefined;
|
|
62
|
+
manager.transportTimer = undefined;
|
|
63
|
+
manager.appTimer = undefined;
|
|
64
|
+
manager.legacyTransportTimer = undefined;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const buildConfig = () => {
|
|
21
68
|
const values = getConfigValue();
|
|
22
69
|
const pro = values?.process ?? {};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
70
|
+
return {
|
|
71
|
+
restartDelay: Number(pro?.restart_delay ?? 3000),
|
|
72
|
+
controlReadyTimeout: Number(pro?.control_ready_timeout ?? 10000),
|
|
73
|
+
transportReadyTimeout: Number(pro?.transport_ready_timeout ?? 15000),
|
|
74
|
+
appReadyTimeout: Number(pro?.app_ready_timeout ?? 30000),
|
|
75
|
+
maxRestartDelay: Number(pro?.max_restart_delay ?? 30000),
|
|
76
|
+
legacyTransportGraceMs: Number(pro?.legacy_transport_grace_ms ?? 50)
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const resetBootState = () => {
|
|
80
|
+
moduleState = {
|
|
81
|
+
...moduleState,
|
|
82
|
+
phase: 'booting',
|
|
83
|
+
protocolVersion: 'legacy',
|
|
84
|
+
transportMode: 'unknown',
|
|
85
|
+
legacyReadyMode: false,
|
|
86
|
+
startedAt: Date.now(),
|
|
87
|
+
lastReadyAt: undefined,
|
|
88
|
+
lastTransportReadyAt: undefined,
|
|
89
|
+
lastAppReadyAt: undefined,
|
|
90
|
+
bootTimings: {},
|
|
91
|
+
lastError: null
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
const updateTransportBinding = (transportMode) => {
|
|
95
|
+
if (transportMode === 'ipc' && moduleManager?.child) {
|
|
96
|
+
setClientChild(moduleManager.child);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
setClientChild(null);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const markFailure = (error) => {
|
|
103
|
+
moduleState = {
|
|
104
|
+
...moduleState,
|
|
105
|
+
phase: 'failed',
|
|
106
|
+
lastError: error ? normalizeErrorMessage(error) : moduleState.lastError,
|
|
107
|
+
consecutiveFailures: moduleState.consecutiveFailures + 1
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const markTransportReady = (transport, legacyReadyMode = false) => {
|
|
111
|
+
const now = Date.now();
|
|
112
|
+
if (!moduleManager) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
moduleManager.transportReady = true;
|
|
116
|
+
clearTimer(moduleManager.transportTimer);
|
|
117
|
+
clearTimer(moduleManager.legacyTransportTimer);
|
|
118
|
+
moduleManager.transportTimer = undefined;
|
|
119
|
+
moduleManager.legacyTransportTimer = undefined;
|
|
120
|
+
moduleState = {
|
|
121
|
+
...moduleState,
|
|
122
|
+
phase: moduleState.lastAppReadyAt ? 'app_ready' : 'transport_ready',
|
|
123
|
+
transportMode: transport,
|
|
124
|
+
lastTransportReadyAt: now,
|
|
125
|
+
legacyReadyMode,
|
|
126
|
+
consecutiveFailures: 0,
|
|
127
|
+
bootTimings: {
|
|
128
|
+
...moduleState.bootTimings,
|
|
129
|
+
readyToTransportReadyMs: moduleState.lastReadyAt ? now - moduleState.lastReadyAt : undefined,
|
|
130
|
+
transportReadyToAppReadyMs: moduleState.lastAppReadyAt ? moduleState.lastAppReadyAt - now : moduleState.bootTimings.transportReadyToAppReadyMs
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
updateTransportBinding(transport);
|
|
134
|
+
if (legacyReadyMode) {
|
|
135
|
+
debugLog('module adapter fallback to legacy transport ready');
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const scheduleRestart = (reason) => {
|
|
139
|
+
if (!moduleProcessConfig || !moduleProcessPath) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const baseDelay = moduleProcessConfig.restartDelay;
|
|
143
|
+
const delay = Math.min(baseDelay * 2 ** Math.max(moduleState.consecutiveFailures - 1, 0), moduleProcessConfig.maxRestartDelay);
|
|
144
|
+
moduleState = {
|
|
145
|
+
...moduleState,
|
|
146
|
+
restartCount: moduleState.restartCount + 1
|
|
147
|
+
};
|
|
148
|
+
debugLog('schedule module adapter restart', { reason, delay });
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
startModuleAdapter();
|
|
151
|
+
}, delay);
|
|
152
|
+
};
|
|
153
|
+
const cleanupManager = (manager) => {
|
|
154
|
+
clearManagerTimers(manager);
|
|
155
|
+
if (manager?.child) {
|
|
156
|
+
manager.child.removeAllListeners();
|
|
157
|
+
}
|
|
158
|
+
setClientChild(null);
|
|
159
|
+
if (moduleManager === manager) {
|
|
160
|
+
moduleManager = null;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const handleControlReady = (manager, message) => {
|
|
164
|
+
const protocolVersion = message.protocolVersion === 'v2' ? 'v2' : 'legacy';
|
|
165
|
+
const now = Date.now();
|
|
166
|
+
manager.protocolVersion = protocolVersion;
|
|
167
|
+
clearTimer(manager.controlTimer);
|
|
168
|
+
manager.controlTimer = undefined;
|
|
169
|
+
moduleState = {
|
|
170
|
+
...moduleState,
|
|
171
|
+
phase: 'control_ready',
|
|
172
|
+
protocolVersion,
|
|
173
|
+
legacyReadyMode: protocolVersion === 'legacy',
|
|
174
|
+
lastReadyAt: now,
|
|
175
|
+
bootTimings: {
|
|
176
|
+
...moduleState.bootTimings,
|
|
177
|
+
forkToReadyMs: moduleState.startedAt ? now - moduleState.startedAt : undefined
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
manager.child?.send?.({ type: 'start' });
|
|
181
|
+
if (protocolVersion === 'v2') {
|
|
182
|
+
manager.transportTimer = setTimeout(() => {
|
|
183
|
+
logger?.warn?.({
|
|
184
|
+
code: ResultCode.Fail,
|
|
185
|
+
message: '模块加载进程未在规定时间内建立通讯层,正在重启',
|
|
186
|
+
data: null
|
|
187
|
+
});
|
|
188
|
+
manager.isKilling = true;
|
|
189
|
+
markFailure('transport_ready_timeout');
|
|
190
|
+
try {
|
|
191
|
+
manager.child?.kill();
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
cleanupManager(manager);
|
|
195
|
+
scheduleRestart('transport_ready_timeout');
|
|
196
|
+
}
|
|
197
|
+
}, moduleProcessConfig?.transportReadyTimeout ?? 15000);
|
|
198
|
+
manager.appTimer = setTimeout(() => {
|
|
199
|
+
logger?.warn?.({
|
|
200
|
+
code: ResultCode.Warn,
|
|
201
|
+
message: '模块加载进程业务初始化较慢,尚未收到 app_ready',
|
|
202
|
+
data: null
|
|
203
|
+
});
|
|
204
|
+
}, moduleProcessConfig?.appReadyTimeout ?? 30000);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
const legacyTransportMode = process.env.__ALEMON_DIRECT_SOCK ? 'direct' : 'ipc';
|
|
208
|
+
manager.legacyTransportTimer = setTimeout(() => {
|
|
209
|
+
if (!manager.transportReady) {
|
|
210
|
+
markTransportReady(legacyTransportMode, true);
|
|
211
|
+
}
|
|
212
|
+
}, moduleProcessConfig?.legacyTransportGraceMs ?? 50);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const handleMessage = (manager, message) => {
|
|
216
|
+
const data = typeof message === 'string' ? JSON.parse(message) : message;
|
|
217
|
+
if (data?.type === 'ready') {
|
|
218
|
+
handleControlReady(manager, data);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (data?.type === 'transport_ready') {
|
|
222
|
+
markTransportReady(data.transport ?? 'unknown');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (data?.type === 'app_ready') {
|
|
226
|
+
const now = Date.now();
|
|
227
|
+
manager.appReady = true;
|
|
228
|
+
clearTimer(manager.appTimer);
|
|
229
|
+
manager.appTimer = undefined;
|
|
230
|
+
moduleState = {
|
|
231
|
+
...moduleState,
|
|
232
|
+
phase: 'app_ready',
|
|
233
|
+
lastAppReadyAt: now,
|
|
234
|
+
bootTimings: {
|
|
235
|
+
...moduleState.bootTimings,
|
|
236
|
+
transportReadyToAppReadyMs: moduleState.lastTransportReadyAt
|
|
237
|
+
? now - moduleState.lastTransportReadyAt
|
|
238
|
+
: moduleState.bootTimings.transportReadyToAppReadyMs
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (data?.type === 'boot_error') {
|
|
244
|
+
moduleState = {
|
|
245
|
+
...moduleState,
|
|
246
|
+
lastError: normalizeErrorMessage(data.error?.message ?? data.error)
|
|
247
|
+
};
|
|
248
|
+
logger?.warn?.({
|
|
249
|
+
code: ResultCode.Fail,
|
|
250
|
+
message: `模块加载进程启动阶段失败: ${String(data.stage ?? 'unknown')}`,
|
|
251
|
+
data: data.error ?? null
|
|
252
|
+
});
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (data?.type === 'ipc:data') {
|
|
256
|
+
forwardFromClient(data.data);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const getModuleAdapterState = () => ({
|
|
260
|
+
...moduleState,
|
|
261
|
+
bootTimings: { ...moduleState.bootTimings }
|
|
262
|
+
});
|
|
263
|
+
function restartModuleAdapter() {
|
|
264
|
+
if (!moduleManager?.child) {
|
|
265
|
+
startModuleAdapter();
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if (moduleManager.restartRequested) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
moduleManager.restartRequested = true;
|
|
272
|
+
moduleManager.isKilling = true;
|
|
273
|
+
moduleState = {
|
|
274
|
+
...moduleState,
|
|
275
|
+
phase: 'stopping'
|
|
27
276
|
};
|
|
277
|
+
clearManagerTimers(moduleManager);
|
|
28
278
|
try {
|
|
29
|
-
|
|
279
|
+
moduleManager.child.kill();
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
cleanupManager(moduleManager);
|
|
283
|
+
scheduleRestart('manual_restart');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function startModuleAdapter() {
|
|
287
|
+
moduleProcessConfig = buildConfig();
|
|
288
|
+
try {
|
|
289
|
+
moduleProcessPath = require$1.resolve('../../client.js');
|
|
30
290
|
}
|
|
31
291
|
catch (error) {
|
|
32
292
|
logger?.warn?.({
|
|
@@ -34,112 +294,91 @@ function startModuleAdapter() {
|
|
|
34
294
|
message: '模块加载进程启动失败',
|
|
35
295
|
data: error
|
|
36
296
|
});
|
|
297
|
+
markFailure(error);
|
|
37
298
|
return;
|
|
38
299
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
|
|
300
|
+
if (moduleManager?.child && moduleManager.child.exitCode === null && !moduleManager.child.killed) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
resetBootState();
|
|
304
|
+
const manager = {
|
|
305
|
+
isKilling: false,
|
|
306
|
+
restartRequested: false,
|
|
307
|
+
transportReady: false,
|
|
308
|
+
appReady: false,
|
|
309
|
+
protocolVersion: 'legacy'
|
|
310
|
+
};
|
|
311
|
+
moduleManager = manager;
|
|
312
|
+
manager.controlTimer = setTimeout(() => {
|
|
313
|
+
logger?.error?.({
|
|
314
|
+
code: ResultCode.Fail,
|
|
315
|
+
message: '模块加载进程未及时发送 ready,正在重启',
|
|
316
|
+
data: null
|
|
317
|
+
});
|
|
318
|
+
manager.isKilling = true;
|
|
319
|
+
markFailure('control_ready_timeout');
|
|
320
|
+
try {
|
|
321
|
+
manager.child?.kill();
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
cleanupManager(manager);
|
|
325
|
+
scheduleRestart('control_ready_timeout');
|
|
326
|
+
}
|
|
327
|
+
}, moduleProcessConfig.controlReadyTimeout);
|
|
328
|
+
try {
|
|
329
|
+
manager.child = childProcess.fork(moduleProcessPath, [], {
|
|
330
|
+
execArgv: process.execArgv,
|
|
331
|
+
env: { ...process.env, __ALEMON_IPC: '1' },
|
|
332
|
+
serialization: 'advanced'
|
|
333
|
+
});
|
|
334
|
+
manager.child.on('exit', (code, signal) => {
|
|
335
|
+
cleanupManager(manager);
|
|
336
|
+
if (manager.isKilling || manager.restartRequested) {
|
|
337
|
+
scheduleRestart(manager.restartRequested ? 'manual_restart' : 'timeout_or_kill');
|
|
59
338
|
return;
|
|
60
339
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, CONFIG.RESTART_DELAY);
|
|
66
|
-
};
|
|
67
|
-
const checkTimeout = () => {
|
|
68
|
-
if (!manager.ready) {
|
|
69
|
-
logger?.error?.({
|
|
70
|
-
code: ResultCode.Fail,
|
|
71
|
-
message: '模块加载未及时响应(未发送 ready 消息)',
|
|
72
|
-
data: null
|
|
73
|
-
});
|
|
74
|
-
try {
|
|
75
|
-
manager.child?.kill();
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
try {
|
|
82
|
-
manager.child = childProcess.fork(modulePath, [], {
|
|
83
|
-
execArgv: process.execArgv,
|
|
84
|
-
env: { ...process.env, __ALEMON_IPC: '1' },
|
|
85
|
-
serialization: 'advanced'
|
|
86
|
-
});
|
|
87
|
-
manager.timer = setTimeout(checkTimeout, CONFIG.FORK_TIMEOUT);
|
|
88
|
-
manager.child.on('exit', (code, signal) => {
|
|
89
|
-
cleanup();
|
|
90
|
-
logger?.warn?.({
|
|
91
|
-
code: ResultCode.Fail,
|
|
92
|
-
message: `模块加载子进程已退出,code=${code}, signal=${signal},${CONFIG.RESTART_DELAY / 1000}秒后自动重启`,
|
|
93
|
-
data: null
|
|
94
|
-
});
|
|
95
|
-
restart();
|
|
96
|
-
});
|
|
97
|
-
manager.child.on('message', (message) => {
|
|
98
|
-
try {
|
|
99
|
-
const data = typeof message === 'string' ? JSON.parse(message) : message;
|
|
100
|
-
if (data?.type === 'ready') {
|
|
101
|
-
manager.ready = true;
|
|
102
|
-
clearTimer();
|
|
103
|
-
setClientChild(manager.child);
|
|
104
|
-
logger?.debug?.({
|
|
105
|
-
code: ResultCode.Ok,
|
|
106
|
-
message: '模块加载已就绪(IPC)',
|
|
107
|
-
data: null
|
|
108
|
-
});
|
|
109
|
-
manager.child?.send?.({ type: 'start' });
|
|
110
|
-
}
|
|
111
|
-
else if (data?.type === 'ipc:data') {
|
|
112
|
-
forwardFromClient(data.data);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
logger?.error?.({
|
|
117
|
-
code: ResultCode.Fail,
|
|
118
|
-
message: '模块加载进程通信数据格式错误',
|
|
119
|
-
data: error
|
|
120
|
-
});
|
|
121
|
-
}
|
|
340
|
+
logger?.warn?.({
|
|
341
|
+
code: ResultCode.Fail,
|
|
342
|
+
message: `模块加载子进程已退出,code=${code}, signal=${signal},稍后自动重启`,
|
|
343
|
+
data: null
|
|
122
344
|
});
|
|
123
|
-
|
|
345
|
+
markFailure(`exit:${code ?? 'null'}:${signal ?? 'null'}`);
|
|
346
|
+
scheduleRestart('unexpected_exit');
|
|
347
|
+
});
|
|
348
|
+
manager.child.on('message', message => {
|
|
349
|
+
try {
|
|
350
|
+
handleMessage(manager, message);
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
124
353
|
logger?.error?.({
|
|
125
354
|
code: ResultCode.Fail,
|
|
126
|
-
message: '
|
|
355
|
+
message: '模块加载进程通信数据格式错误',
|
|
127
356
|
data: error
|
|
128
357
|
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
logger?.
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
manager.child.on('error', error => {
|
|
361
|
+
logger?.error?.({
|
|
133
362
|
code: ResultCode.Fail,
|
|
134
|
-
message: '
|
|
363
|
+
message: '模块加载子进程发生错误',
|
|
135
364
|
data: error
|
|
136
365
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
366
|
+
moduleState = {
|
|
367
|
+
...moduleState,
|
|
368
|
+
lastError: normalizeErrorMessage(error)
|
|
369
|
+
};
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
cleanupManager(manager);
|
|
374
|
+
logger?.warn?.({
|
|
375
|
+
code: ResultCode.Fail,
|
|
376
|
+
message: 'fork 启动模块加载失败',
|
|
377
|
+
data: error
|
|
378
|
+
});
|
|
379
|
+
markFailure(error);
|
|
380
|
+
scheduleRestart('fork_error');
|
|
381
|
+
}
|
|
143
382
|
}
|
|
144
383
|
|
|
145
|
-
export { startModuleAdapter };
|
|
384
|
+
export { getModuleAdapterState, restartModuleAdapter, startModuleAdapter };
|