channel-worker 2.1.2 → 2.1.3
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/lib/api-client.js +4 -0
- package/lib/command-poller.js +3 -1
- package/package.json +1 -1
package/lib/api-client.js
CHANGED
|
@@ -90,6 +90,10 @@ class ApiClient {
|
|
|
90
90
|
return this.request('GET', `/workers/renderer-has-commands?nst_profile_id=${encodeURIComponent(nstProfileId)}`);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
async resetRendererCommands(nstProfileId) {
|
|
94
|
+
return this.request('POST', '/workers/reset-renderer-commands', { nst_profile_id: nstProfileId });
|
|
95
|
+
}
|
|
96
|
+
|
|
93
97
|
// Extension download
|
|
94
98
|
async getExtensionVersion() {
|
|
95
99
|
const data = await this.request('GET', '/extension-download/version');
|
package/lib/command-poller.js
CHANGED
|
@@ -1165,9 +1165,11 @@ class CommandPoller {
|
|
|
1165
1165
|
if (cmdCount > 0) {
|
|
1166
1166
|
console.log(`[scene-dispatch] Crash recovery: ${r.name} has ${cmdCount} commands but not running — relaunching`);
|
|
1167
1167
|
try {
|
|
1168
|
+
// Reset stuck "running" commands back to "pending" so extension can pick them up
|
|
1169
|
+
await this.api.resetRendererCommands(r.nst_profile_id);
|
|
1168
1170
|
await this._launchRendererProfile(r);
|
|
1169
1171
|
runningRenderers.push(r);
|
|
1170
|
-
console.log(`[scene-dispatch] ${r.name} recovered`);
|
|
1172
|
+
console.log(`[scene-dispatch] ${r.name} recovered (${cmdCount} commands reset)`);
|
|
1171
1173
|
} catch (err) {
|
|
1172
1174
|
console.error(`[scene-dispatch] Failed to recover ${r.name}: ${err.message}`);
|
|
1173
1175
|
}
|