Skip to content

Commit

Permalink
patch: ensure ipc names are different
Browse files Browse the repository at this point in the history
  • Loading branch information
aethernet committed Sep 15, 2023
1 parent ef40e50 commit 63103af
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/gui/app/modules/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ const THREADS_PER_CPU = 16;
ipc.config.silent = true;

// There might be multiple Etcher instances running at
// the same time, therefore we must ensure each IPC
// the same time, also we might spawn multiple child and api so we must ensure each IPC
// server/client has a different name.
const IPC_SERVER_ID = `etcher-server-${process.pid}-${Date.now()}}`;
const IPC_CLIENT_ID = `etcher-client-${process.pid}-${Date.now()}}`;
const IPC_SERVER_ID = `etcher-server-${
process.pid
}-${Date.now()}-${Math.random()}}`;
const IPC_CLIENT_ID = `etcher-client-${
process.pid
}-${Date.now()}-${Math.random()}}`;

ipc.config.id = IPC_SERVER_ID;
ipc.config.socketRoot = path.join(
Expand Down

0 comments on commit 63103af

Please sign in to comment.