fix(server): avoid false restore failures on large database imports (#27420)

* fix(server): increase restore health check timeout and reject with Error

* chore: clean up

---------

Co-authored-by: André Erasmus <25480506+NoBadDays@users.noreply.github.com>
Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
André Erasmus 2026-04-08 22:03:41 +02:00 committed by GitHub
parent 781d568f29
commit 55ab8c65b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,15 +36,17 @@ export class MaintenanceHealthRepository {
}
});
worker.on('exit', (code, signal) => reject(`Server health check failed, server exited with ${signal ?? code}`));
worker.on('error', (error) => reject(`Server health check failed, process threw: ${error}`));
worker.on('exit', (code, signal) =>
reject(new Error(`Server health check failed, server exited with ${signal ?? code}`)),
);
worker.on('error', (error) => reject(new Error(`Server health check failed, process threw: ${error}`)));
setTimeout(() => {
if (worker.exitCode === null) {
reject('Server health check failed, took too long to start.');
reject(new Error('Server health check failed, took too long to start.'));
worker.kill('SIGTERM');
}
}, 20_000);
}, 180_000);
});
}
}