Skip to content

Commit edf4347

Browse files
emizzle0x-r4bbit
authored andcommitted
fix(@embark/storage): Fix hang when changing environments
Fix an issue with storage process launcher hanging when changing environments. This occurred most frequently when the IPFS process was forced to restart due to the change in environment. Change in enviroment can be considered: 1. `embark run env1` 2. `Ctrl+c` 3. `embark run env2`
1 parent 095bd0b commit edf4347

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/plugins/ipfs/src/storageProcessesLauncher.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class StorageProcessesLauncher {
151151
self.logger.info(__(`Restarting ${storageName} process...`).cyan);
152152
self.processes[storageName].kill();
153153
delete this.processes[storageName];
154+
self.launchProcess(storageName, callback);
154155
});
155156

156157
self.processes[storageName].on('result', constants.storage.exit, ({error}) => {

packages/plugins/swarm/src/storageProcessesLauncher.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class StorageProcessesLauncher {
8787
}
8888
if (this.restartCalled) {
8989
this.restartCalled = false;
90-
return this.launchProcess(storageName, () => {});
90+
return;
9191
}
9292
this.logger.error(__(`Storage process for {{storageName}} ended before the end of this process. Code: {{code}}`, {storageName, code}));
9393
}
@@ -150,6 +150,7 @@ class StorageProcessesLauncher {
150150
self.logger.info(__(`Restarting ${storageName} process...`).cyan);
151151
self.processes[storageName].kill();
152152
delete this.processes[storageName];
153+
self.launchProcess(storageName, callback);
153154
});
154155

155156
self.processes[storageName].on('result', constants.storage.exit, ({error}) => {

0 commit comments

Comments
 (0)