Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function worker(eventsCount, reportObj) {
const store = mongoDbAdapter({
url: config.MONGODB_CONNECTION_URL,
collection: config.MONGODB_COLLECTION_NAME
});
return store.loadEventsByTypes(TYPES, () => reportObj.value++);
}
export default function preparer(eventsCount, reportObj) {
const storage = mongoDbAdapter({
url: config.MONGODB_CONNECTION_URL,
collection: config.MONGODB_COLLECTION_NAME
});
const bus = memoryAdapter();
const eventStore = createEventStore({
storage,
bus
});
const commandExecute = createCommandExecutor({ eventStore, aggregates });
return dropCollection(config.MONGODB_CONNECTION_URL, config.MONGODB_COLLECTION_NAME).then(() =>
commandGenerator(commandExecute, eventsWeight, eventsCount / entitiesFactor, reportObj)
);
export default function preparer(eventsCount, reportObj) {
const storage = mongoDbAdapter({
url: config.MONGODB_CONNECTION_URL,
collection: config.MONGODB_COLLECTION_NAME
});
return dropCollection(config.MONGODB_CONNECTION_URL, config.MONGODB_COLLECTION_NAME).then(() =>
generateEvents(storage.saveEvent.bind(storage), eventsCount, reportObj)
);
}
export default function worker(eventsCount, reportObj) {
const mongoAdapter = mongoDbAdapter({
url: config.MONGODB_CONNECTION_URL,
collection: config.MONGODB_COLLECTION_NAME
});
const bus = memoryAdapter();
const readModels = readModelsGenerator(reportObj);
const execute = generateSyncExecutor(mongoAdapter, bus, readModels);
return execute('infrastructureState').then(state => ({
entities:
Object.keys(state.groups).length +
Object.keys(state.members).length +
Object.keys(state.items).length
}));