mirror of
https://github.com/unraid/api.git
synced 2026-01-01 22:20:05 -06:00
fix: cleaner logs for starting API
This commit is contained in:
@@ -43,10 +43,10 @@ export async function bootstrapNestServer(): Promise<NestFastifyApplication> {
|
|||||||
|
|
||||||
if (Number.isNaN(parseInt(PORT))) {
|
if (Number.isNaN(parseInt(PORT))) {
|
||||||
const result = await server.listen({ path: '/var/run/unraid-api.sock' });
|
const result = await server.listen({ path: '/var/run/unraid-api.sock' });
|
||||||
console.log('Server listening on %s', result);
|
apiLogger.info('Server listening on %s', result);
|
||||||
} else {
|
} else {
|
||||||
const result = await server.listen({ port: parseInt(PORT), host: '0.0.0.0' });
|
const result = await server.listen({ port: parseInt(PORT), host: '0.0.0.0' });
|
||||||
console.log('Server listening on %s', result);
|
apiLogger.info('Server listening on %s', result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This 'ready' signal tells pm2 that the api has started.
|
// This 'ready' signal tells pm2 that the api has started.
|
||||||
@@ -55,7 +55,9 @@ export async function bootstrapNestServer(): Promise<NestFastifyApplication> {
|
|||||||
if (process.send) {
|
if (process.send) {
|
||||||
process.send('ready');
|
process.send('ready');
|
||||||
} else {
|
} else {
|
||||||
console.log('Warning: process.send is unavailable. This will affect IPC communication with PM2.');
|
apiLogger.warn(
|
||||||
|
'Warning: process.send is unavailable. This will affect IPC communication with PM2.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
apiLogger.info('Nest Server is now listening');
|
apiLogger.info('Nest Server is now listening');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user