channel-worker 1.6.11 → 1.6.13

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.
Files changed (2) hide show
  1. package/lib/nst-manager.js +12 -4
  2. package/package.json +1 -1
@@ -20,7 +20,7 @@ class NstManager {
20
20
  // Get all running browsers
21
21
  async getRunningBrowsers() {
22
22
  try {
23
- const rawRes = await fetch(`${this.baseUrl}/browsers/running`, {
23
+ const rawRes = await fetch(`${this.baseUrl}/browsers`, {
24
24
  headers: { 'x-api-key': this.apiKey },
25
25
  });
26
26
  const text = await rawRes.text();
@@ -127,10 +127,18 @@ class NstManager {
127
127
  }
128
128
 
129
129
  // If already running, stop first then relaunch
130
- if (await this.isProfileRunning(profileId)) {
130
+ const running = await this.getRunningBrowsers();
131
+ console.log(`[nst] Running browsers: ${running.map(b => b.name || b.profileId).join(', ') || 'none'}`);
132
+ const isRunning = running.some(b => b.profileId === profileId);
133
+ if (isRunning) {
131
134
  console.log(`[nst] Profile ${profileId} already running — stopping first`);
132
- await this.stopProfile(profileId);
133
- await new Promise(r => setTimeout(r, 2000));
135
+ try {
136
+ await this.stopProfile(profileId);
137
+ console.log(`[nst] Stop command sent, waiting 3s...`);
138
+ await new Promise(r => setTimeout(r, 3000));
139
+ } catch (e) {
140
+ console.warn(`[nst] Stop failed: ${e.message} — continuing anyway`);
141
+ }
134
142
  }
135
143
 
136
144
  // Update profile language to en-US (Custom) before launch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channel-worker",
3
- "version": "1.6.11",
3
+ "version": "1.6.13",
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": {