Skip to content

Commit

Permalink
Merge pull request #398 from internxt/fix/relaunc-when-closed-unexpec…
Browse files Browse the repository at this point in the history
…tedly

[_] fix: relaunch when closed unexpectedly
  • Loading branch information
JoanVicens authored Oct 17, 2023
2 parents 30595a3 + 8ab8fd0 commit 2fbca82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/background-processes/sync-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ function spawnSyncEngineWorker() {

worker.on('close', () => {
worker?.destroy();

if (workerIsRunning) {
Logger.warn('The sync engine process ended unexpectedly, relaunching');
workerIsRunning = false;
spawnSyncEngineWorker();
}
});

ipcMain.once('SYNC_ENGINE_PROCESS_SETUP_SUCCESSFUL', () => {
Expand Down

0 comments on commit 2fbca82

Please sign in to comment.