<commit_before>'use strict';

if (process.env.NEW_RELIC_ENABLED === 'true') require('newrelic');

var config = require('./config/config.js')();
var seneca = require('seneca')(config);
var store = require('seneca-postgresql-store');

seneca.log.info('using config', JSON.stringify(config, null, 4));

seneca.options(config);

seneca.use(store, config['postgresql-store']);
if (process.env.MAILTRAP_ENABLED === 'true') {
  seneca.use('mail', config.mailtrap);
} else {
  seneca.use('mail', config.gmail);
}

require('./migrate-psql-db.js')(function (err) {
  if (err) {
    console.error(err);
    process.exit(-1);
  }
  console.log('Migrations ok');

  seneca.use(require('./email-notifications.js'));
  seneca.use(require('./agreements.js'));
  seneca.use(require('./profiles.js'), { postgresql: config['postgresql-store'] });
  seneca.use(require('./oauth2.js'), config.oauth2);
  seneca.use('user');
  seneca.use('auth');
  seneca.use(require('./users.js'),
            { 'email-notifications': config['email-notifications'],
              'postgresql': config['postgresql-store'],
              'users': config['users']
            });
  seneca.use(require('./nodebb-api.js'), config.nodebb);

  seneca.listen()
  .client({ type: 'web', port: 10304, pin: { role: 'cd-salesforce', cmd: '*' } })
  .client({ type: 'web', port: 10301, pin: 'role:cd-dojos,cmd:*' });
});<commit_msg>Moved salesforce related functionnalities into remote queue in cp-salesforce-service<commit_after>'use strict';

if (process.env.NEW_RELIC_ENABLED === 'true') require('newrelic');

var config = require('./config/config.js')();
var seneca = require('seneca')(config);
var store = require('seneca-postgresql-store');

seneca.log.info('using config', JSON.stringify(config, null, 4));

seneca.options(config);

seneca.use(store, config['postgresql-store']);
if (process.env.MAILTRAP_ENABLED === 'true') {
  seneca.use('mail', config.mailtrap);
} else {
  seneca.use('mail', config.gmail);
}

require('./migrate-psql-db.js')(function (err) {
  if (err) {
    console.error(err);
    process.exit(-1);
  }
  console.log('Migrations ok');

  seneca.use(require('./email-notifications.js'));
  seneca.use(require('./agreements.js'));
  seneca.use(require('./profiles.js'), { postgresql: config['postgresql-store'] });
  seneca.use(require('./oauth2.js'), config.oauth2);
  seneca.use('user');
  seneca.use('auth');
  seneca.use(require('./users.js'),
            { 'email-notifications': config['email-notifications'],
              'postgresql': config['postgresql-store'],
              'users': config['users']
            });
  seneca.use(require('./nodebb-api.js'), config.nodebb);
  // seneca.act({ role: 'queue', cmd: 'start' });

  seneca.listen()
  .client({ type: 'web', port: 10304, pin: { role: 'cd-salesforce', cmd: '*' } })
  .client({ type: 'web', port: 10301, pin: 'role:cd-dojos,cmd:*' });
});
{'fraction_non_alphanumeric': 0.21871750433275564, 'fraction_numerical': 0.009705372616984401, 'mean_word_length': 4.256830601092896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1812092', 'n_tokens_mistral': 1020, 'n_tokens_neox': 1002, 'n_words': 161}