Skip to content

Commit

Permalink
fix notification service max payload
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <[email protected]>
  • Loading branch information
simvalery committed Dec 4, 2024
1 parent 346ebff commit d6b6234
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion notification-service/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApplicationState, COMMON_CONNECTION_CONFIG, DatabaseServer, GenerateTLSOptionsNats, MessageBrokerChannel, Migration, mongoForLoggingInitialization, PinoLogger, pinoLoggerInitialization } from '@guardian/common';
import { ApplicationState, COMMON_CONNECTION_CONFIG, DatabaseServer, GenerateTLSOptionsNats, LargePayloadContainer, MessageBrokerChannel, Migration, mongoForLoggingInitialization, PinoLogger, pinoLoggerInitialization } from '@guardian/common';
import { ApplicationStates } from '@guardian/interfaces';
import { MikroORM } from '@mikro-orm/core';
import { MongoDriver } from '@mikro-orm/mongodb';
Expand Down Expand Up @@ -54,6 +54,12 @@ Promise.all([
state.updateState(ApplicationStates.STARTED);
state.updateState(ApplicationStates.INITIALIZING);
state.updateState(ApplicationStates.READY);

const maxPayload = parseInt(process.env.MQ_MAX_PAYLOAD, 10);
if (Number.isInteger(maxPayload)) {
new LargePayloadContainer().runServer();
}

await logger.info('notification service started', ['NOTIFICATION_SERVICE']);
},
(reason) => {
Expand Down

0 comments on commit d6b6234

Please sign in to comment.