channel-worker 1.6.10 → 1.6.11
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/nst-manager.js +5 -4
- package/package.json +1 -1
package/lib/nst-manager.js
CHANGED
|
@@ -126,10 +126,11 @@ class NstManager {
|
|
|
126
126
|
profileId = await this.ensureProfile(profileIdOrName);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// If already running,
|
|
129
|
+
// If already running, stop first then relaunch
|
|
130
130
|
if (await this.isProfileRunning(profileId)) {
|
|
131
|
-
console.log(`[nst] Profile ${profileId} already running —
|
|
132
|
-
|
|
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}
|
|
194
|
+
await this.api(`/browsers/${profileId}`, { method: 'DELETE' });
|
|
194
195
|
console.log(`[nst] Browser stopped`);
|
|
195
196
|
}
|
|
196
197
|
|