1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-10 22:11:50 +02:00

Transcribe: Resolves #12862: Add log statement signaling that the startup has finished (#12876)

This commit is contained in:
pedr
2025-08-05 08:26:10 -03:00
committed by GitHub
parent 0e19dce0d1
commit f725d3895f

View File

@@ -1,6 +1,6 @@
require('dotenv').config();
import * as Koa from 'koa';
import Logger from '@joplin/utils/Logger';
import Logger, { LoggerWrapper } from '@joplin/utils/Logger';
import koaBody from 'koa-body';
import initiateLogger from '../services/initiateLogger';
import createQueue from '../services/createQueue';
@@ -10,12 +10,11 @@ import env, { EnvVariables } from '../env';
import HtrCli from '../core/HtrCli';
import JobProcessor from '../workers/JobProcessor';
initiateLogger();
const logger = Logger.create('api/app');
const init = async () => {
const init = async (logger: LoggerWrapper) => {
const envVariables = env();
logger.info('Checking configurations');
await checkServerConfigurations(envVariables);
const app = new Koa();
@@ -26,6 +25,7 @@ const init = async () => {
await router(app, envVariables.API_KEY);
logger.info('Creating queue');
const queue = await createQueue(envVariables, true);
const fileStorage = new FileStorage();
@@ -39,6 +39,7 @@ const init = async () => {
logger.info('Starting worker');
await jobProcessor.init();
logger.info('Server started successfully');
};
const checkServerConfigurations = (envVariables: EnvVariables) => {
@@ -47,12 +48,13 @@ const checkServerConfigurations = (envVariables: EnvVariables) => {
};
const main = async () => {
initiateLogger();
const logger = Logger.create('api/app');
logger.info('Starting...');
await init();
await init(logger);
};
main().catch(error => {
console.error(error);
logger.error(error);
process.exit(1);
});