From 1c4b0fc073d6a82c16cf2f074d44700663500d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 19 Feb 2019 14:36:05 +0100 Subject: [PATCH] bugfixes killInternalProcess --- src/commands/killInternalProcess.js | 7 ++++--- src/helpers/reset.js | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/commands/killInternalProcess.js b/src/commands/killInternalProcess.js index 428fecd4..33ad0102 100644 --- a/src/commands/killInternalProcess.js +++ b/src/commands/killInternalProcess.js @@ -1,10 +1,10 @@ // @flow import { createCommand, Command } from 'helpers/ipc' -import { of } from 'rxjs' +import { never } from 'rxjs' type Input = void -type Result = boolean +type Result = void const cmd: Command = createCommand('killInternalProcess', () => { setTimeout(() => { @@ -12,7 +12,8 @@ const cmd: Command = createCommand('killInternalProcess', () => { // special exit code for better identification process.exit(42) }) - return of(true) + // The command shouldn't finish now because process.exit will make it end! + return never() }) export default cmd diff --git a/src/helpers/reset.js b/src/helpers/reset.js index d0ead9ca..7a8e51ac 100644 --- a/src/helpers/reset.js +++ b/src/helpers/reset.js @@ -10,7 +10,10 @@ import libcoreReset from 'commands/libcoreReset' async function resetLibcore() { // we need to stop everything that is happening right now, like syncs - await killInternalProcess.send().toPromise() + await killInternalProcess + .send() + .toPromise() + .catch(() => {}) // this is a normal error due to the crash of the process, we ignore it // we can now ask libcore to reset itself await libcoreReset.send().toPromise() }