mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
fix(api): delay pm2 start until server has booted
prior to this, pm2 would mark unraid-api as started as soon as the node process started. The Nest server wouldn't finish booting until later. This meant unraid-api could "start", but the webgui wouldn't be fully functional because it couldn't connect to the api yet. This was a sucky user & dev experience.
This commit is contained in:
committed by
Pujit Mehrotra
parent
2327b00d30
commit
3c27b51ab8
@@ -7,6 +7,8 @@
|
||||
"cwd": "/usr/local/unraid-api",
|
||||
"log": "/var/log/unraid-api/unraid-api.log",
|
||||
"exec_mode": "fork",
|
||||
"wait_ready": true,
|
||||
"listen_timeout": 30000,
|
||||
"ignore_watch": [
|
||||
"node_modules",
|
||||
"src",
|
||||
|
||||
@@ -48,7 +48,9 @@ export async function bootstrapNestServer(): Promise<NestFastifyApplication> {
|
||||
const result = await server.listen({ port: parseInt(PORT), host: '0.0.0.0' });
|
||||
console.log('Server listening on %s', result);
|
||||
}
|
||||
|
||||
if (process.send) {
|
||||
process.send('ready');
|
||||
}
|
||||
apiLogger.info('Nest Server is now listening');
|
||||
|
||||
return app;
|
||||
|
||||
Reference in New Issue
Block a user