28 lines
877 B
TypeScript
28 lines
877 B
TypeScript
import 'reflect-metadata'
|
|
|
|
import { OpenTelemetrySDK } from '@standardnotes/domain-events-infra'
|
|
import { ServiceIdentifier } from '@standardnotes/domain-core'
|
|
|
|
const sdk = new OpenTelemetrySDK({ serviceName: ServiceIdentifier.NAMES.WebsocketsWorker })
|
|
sdk.start()
|
|
|
|
import { Logger } from 'winston'
|
|
|
|
import { ContainerConfigLoader } from '../src/Bootstrap/Container'
|
|
import TYPES from '../src/Bootstrap/Types'
|
|
import { Env } from '../src/Bootstrap/Env'
|
|
import { DomainEventSubscriberInterface } from '@standardnotes/domain-events'
|
|
|
|
const container = new ContainerConfigLoader()
|
|
void container.load().then((container) => {
|
|
const env: Env = new Env()
|
|
env.load()
|
|
|
|
const logger: Logger = container.get(TYPES.Logger)
|
|
|
|
logger.info('Starting worker...')
|
|
|
|
const subscriber = container.get<DomainEventSubscriberInterface>(TYPES.DomainEventSubscriber)
|
|
|
|
subscriber.start()
|
|
})
|