channel-worker 1.6.10 → 1.6.12

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.
@@ -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();
@@ -126,10 +126,11 @@ class NstManager {
126
126
  profileId = await this.ensureProfile(profileIdOrName);
127
127
  }
128
128
 
129
- // If already running, skip
129
+ // If already running, stop first then relaunch
130
130
  if (await this.isProfileRunning(profileId)) {
131
- console.log(`[nst] Profile ${profileId} already running — skipping`);
132
- return { profileId, alreadyRunning: true };
131
+ console.log(`[nst] Profile ${profileId} already running — stopping first`);
132
+ await this.stopProfile(profileId);
133
+ await new Promise(r => setTimeout(r, 2000));
133
134
  }
134
135
 
135
136
  // Update profile language to en-US (Custom) before launch
@@ -190,7 +191,7 @@ class NstManager {
190
191
  }
191
192
 
192
193
  console.log(`[nst] Stopping browser for profile: ${profileId}`);
193
- await this.api(`/browsers/${profileId}/stop`, { method: 'PUT' });
194
+ await this.api(`/browsers/${profileId}`, { method: 'DELETE' });
194
195
  console.log(`[nst] Browser stopped`);
195
196
  }
196
197
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channel-worker",
3
- "version": "1.6.10",
3
+ "version": "1.6.12",
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": {