rol-websocket-channel 1.7.5 → 1.7.8
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/dist/index.js +1 -1
- package/dist/src/admin/methods/system.js +7 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/admin/methods/system.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -492,7 +492,7 @@ async function handleIncomingMessage(payload, account, cfg, runtime, log, mqttTo
|
|
|
492
492
|
publishCustomMessageResponse({
|
|
493
493
|
type: "receiver",
|
|
494
494
|
trace_id: traceId,
|
|
495
|
-
source: "system",
|
|
495
|
+
source: "system-pre",
|
|
496
496
|
timestamp: Date.now(),
|
|
497
497
|
success: true,
|
|
498
498
|
data: {
|
|
@@ -101,6 +101,13 @@ export const pluginSelfUpdate = async (_params, context) => {
|
|
|
101
101
|
...result
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
+
// Trigger restart in background after a short delay (e.g. 2 seconds) to allow the MQTT response to be sent
|
|
105
|
+
setTimeout(() => {
|
|
106
|
+
console.log('[system] Triggering automatic restart after plugin update...');
|
|
107
|
+
runOpenClawCommand(['gateway', 'restart'], context, 'pluginSelfUpdate.restart').catch((error) => {
|
|
108
|
+
console.error('[system] Auto-restart after update failed:', error);
|
|
109
|
+
});
|
|
110
|
+
}, 2000);
|
|
104
111
|
return {
|
|
105
112
|
ok: true,
|
|
106
113
|
action: 'pluginSelfUpdate',
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -115,6 +115,14 @@ export const pluginSelfUpdate: MethodHandler = async (_params, context: MethodCo
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
// Trigger restart in background after a short delay (e.g. 2 seconds) to allow the MQTT response to be sent
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
console.log('[system] Triggering automatic restart after plugin update...');
|
|
121
|
+
runOpenClawCommand(['gateway', 'restart'], context, 'pluginSelfUpdate.restart').catch((error) => {
|
|
122
|
+
console.error('[system] Auto-restart after update failed:', error);
|
|
123
|
+
});
|
|
124
|
+
}, 2000);
|
|
125
|
+
|
|
118
126
|
return {
|
|
119
127
|
ok: true,
|
|
120
128
|
action: 'pluginSelfUpdate',
|