feat: Re-compute the given items cost job.

feat: Optimize the architecture.
This commit is contained in:
Ahmed Bouhuolia
2020-08-18 02:28:08 +02:00
parent 4e68a7db71
commit d423365a19
44 changed files with 1605 additions and 798 deletions

View File

@@ -0,0 +1,20 @@
import { Container } from 'typedi';
import LoggerInstance from '@/services/Logger';
import agendaFactory from '@/loaders/agenda';
export default ({ mongoConnection, knex }) => {
try {;
const agendaInstance = agendaFactory({ mongoConnection });
Container.set('agenda', agendaInstance);
Container.set('logger', LoggerInstance)
Container.set('knex', knex);
LoggerInstance.info('Agenda has been injected into container');
return { agenda: agendaInstance };
} catch (e) {
LoggerInstance.error('Error on dependency injector loader: %o', e);
throw e;
}
};