restart: gracefully handle restart failure

In case Grist isn't running with the supervisor (e.g. it's running
under nodemon instead via `yarn start`), surface the problem to the
frontend.
This commit is contained in:
Jordi Gutiérrez Hermoso
2024-07-29 16:28:55 -04:00
committed by jordigh
parent 9ae8918156
commit 960f023618
2 changed files with 11 additions and 5 deletions

View File

@@ -5,7 +5,8 @@ let grist;
function startGrist(newConfig={}) {
// H/T https://stackoverflow.com/a/36995148/11352427
grist = spawn('./sandbox/run.sh', {
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
env: {...process.env, GRIST_RUNNING_UNDER_SUPERVISOR: true}
});
grist.on('message', function(data) {
if (data.action === 'restart') {