channel-worker 2.2.4 → 2.2.5

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.
@@ -1323,7 +1323,17 @@ class CommandPoller {
1323
1323
  const lastActivity = this._profileLastActivity[profileId]
1324
1324
  || (name && this._profileLastActivity[name])
1325
1325
  || 0;
1326
- if (!lastActivity) continue; // never trackedskip (just launched by another process)
1326
+ // If not tracked: check if it has commands if not, close it (orphaned profile)
1327
+ if (!lastActivity) {
1328
+ try {
1329
+ const cmdCount = name ? await this.api.rendererHasCommands(name) : 0;
1330
+ if (cmdCount > 0) continue; // has work, skip
1331
+ } catch {}
1332
+ // No commands + not tracked = orphaned, close
1333
+ console.log(`[profile-timeout] Closing orphaned profile ${browser.name || profileId} (not tracked, no commands)`);
1334
+ try { await this.nst.stopProfile(profileId); } catch {}
1335
+ continue;
1336
+ }
1327
1337
  if ((now - lastActivity) > IDLE_TIMEOUT) {
1328
1338
  console.log(`[profile-timeout] Closing idle profile ${browser.name || profileId} (idle ${Math.round((now - lastActivity) / 1000)}s)`);
1329
1339
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channel-worker",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "Channel Manager worker daemon — runs on remote machines to execute video pipeline jobs",
5
5
  "main": "lib/daemon.js",
6
6
  "bin": {