Skip to content

Commit c77ae27

Browse files
committed
fix(Executor): Do not create new interface if one already created
1 parent 3f4efef commit c77ae27

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/base/Executor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,16 @@ export class Peer {
221221
* @returns A client instance or `undefined` if not able to connect
222222
*/
223223
public connect(): boolean {
224+
// Check if already connected
225+
if (this.interface !== undefined) return true
226+
224227
// If the executor is in-process, just use it directly
225228
// eslint-disable-next-line @typescript-eslint/no-use-before-define
226229
if (this.manifest.executor instanceof Executor) {
227230
this.interface = this.manifest.executor
228231
return true
229232
}
233+
230234
// Connect to remote executor in order of preference of
231235
// transports
232236
for (const ClientType of this.clientTypes) {

0 commit comments

Comments
 (0)