Skip to content

Commit

Permalink
fix(Executor): Do not create new interface if one already created
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Oct 14, 2019
1 parent 3f4efef commit c77ae27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/base/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,16 @@ export class Peer {
* @returns A client instance or `undefined` if not able to connect
*/
public connect(): boolean {
// Check if already connected
if (this.interface !== undefined) return true

// If the executor is in-process, just use it directly
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (this.manifest.executor instanceof Executor) {
this.interface = this.manifest.executor
return true
}

// Connect to remote executor in order of preference of
// transports
for (const ClientType of this.clientTypes) {
Expand Down

0 comments on commit c77ae27

Please sign in to comment.