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