mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Spawn updated Atom immediately instead of waiting for will-quit
event
Spawning the new version of Atom within a `will-quit` handler would cause Electron to quit before having a chance to actually run the executable. There may still be a possibility of raciness between closing the old version of Atom and opening the new one, causing resource contention between the two processes (e.g., IndexedDb) or failing to spawn the new process before the previous one quits. Addressing such raciness perfectly would require a much more complex solution and this approach is working for us consistently in our tests. Co-Authored-By: Nathan Sobo <nathan@github.com>
This commit is contained in:
parent
28a17d7b41
commit
466a1ff18a
@ -165,9 +165,7 @@ exports.restartAtom = app => {
|
||||
const { projectPath } = global.atomApplication.lastFocusedWindow;
|
||||
if (projectPath) args = [projectPath];
|
||||
}
|
||||
app.once('will-quit', () =>
|
||||
Spawner.spawn(path.join(binFolder, 'atom.cmd'), args)
|
||||
);
|
||||
Spawner.spawn(path.join(binFolder, 'atom.cmd'), args);
|
||||
app.quit();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user