29 lines
864 B
TypeScript
29 lines
864 B
TypeScript
import 'reflect-metadata'
|
|
|
|
import 'newrelic'
|
|
|
|
import { Logger } from 'winston'
|
|
|
|
import { ContainerConfigLoader } from '../src/Bootstrap/Container'
|
|
import TYPES from '../src/Bootstrap/Types'
|
|
import { Env } from '../src/Bootstrap/Env'
|
|
import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events'
|
|
import * as dayjs from 'dayjs'
|
|
import * as utc from 'dayjs/plugin/utc'
|
|
|
|
const container = new ContainerConfigLoader()
|
|
void container.load().then((container) => {
|
|
dayjs.extend(utc)
|
|
|
|
const env: Env = new Env()
|
|
env.load()
|
|
|
|
const logger: Logger = container.get(TYPES.Logger)
|
|
|
|
logger.info('Starting worker...')
|
|
|
|
const subscriberFactory: DomainEventSubscriberFactoryInterface = container.get(TYPES.DomainEventSubscriberFactory)
|
|
subscriberFactory.create().start()
|
|
|
|
setInterval(() => logger.info('Alive and kicking!'), 20 * 60 * 1000)
|
|
})
|