fix(syncing-server): binding
This commit is contained in:
parent
aba4f90485
commit
5b06ea94f9
1 changed files with 25 additions and 29 deletions
|
@ -289,11 +289,8 @@ export class ContainerConfigLoader {
|
|||
)
|
||||
})
|
||||
|
||||
container.bind<SQSClient>(TYPES.Sync_SQS).toDynamicValue((context: interfaces.Context) => {
|
||||
const env: Env = context.container.get(TYPES.Sync_Env)
|
||||
|
||||
const sqsConfig: SQSClientConfig = {
|
||||
region: env.get('SQS_AWS_REGION'),
|
||||
region: env.get('SQS_AWS_REGION', true),
|
||||
}
|
||||
if (env.get('SQS_ENDPOINT', true)) {
|
||||
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
|
||||
|
@ -304,9 +301,8 @@ export class ContainerConfigLoader {
|
|||
secretAccessKey: env.get('SQS_SECRET_ACCESS_KEY', true),
|
||||
}
|
||||
}
|
||||
|
||||
return new SQSClient(sqsConfig)
|
||||
})
|
||||
const sqsClient = new SQSClient(sqsConfig)
|
||||
container.bind<SQSClient>(TYPES.Sync_SQS).toConstantValue(sqsClient)
|
||||
|
||||
container.bind<S3Client | undefined>(TYPES.Sync_S3).toDynamicValue((context: interfaces.Context) => {
|
||||
const env: Env = context.container.get(TYPES.Sync_Env)
|
||||
|
@ -1138,7 +1134,6 @@ export class ContainerConfigLoader {
|
|||
container
|
||||
.bind<DomainEventMessageHandlerInterface>(TYPES.Sync_DomainEventMessageHandler)
|
||||
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Sync_Logger)))
|
||||
}
|
||||
|
||||
container
|
||||
.bind<DomainEventSubscriberInterface>(TYPES.Sync_DomainEventSubscriber)
|
||||
|
@ -1151,6 +1146,7 @@ export class ContainerConfigLoader {
|
|||
container.get<Logger>(TYPES.Sync_Logger),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
container
|
||||
.bind<ControllerContainerInterface>(TYPES.Sync_ControllerContainer)
|
||||
|
|
Loading…
Reference in a new issue