<commit_before>'use strict';

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

var _ =require('lodash');
var config = require('./config/config.js')();
var seneca = require('seneca')();

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

seneca.options(config);

seneca.use('postgresql-store', config["postgresql-store"]);
if(process.env.MAILTRAP_ENABLED === 'true') {
  seneca.use('mail', config.mailtrap);
} else {
  seneca.use('mail', config.gmail);
}
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']});
seneca.use(require('./nodebb-api.js'), config.nodebb);

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

  seneca.listen()
  .client({type: 'web', host: process.env.DOCKER_HOST_IP || process.env.TARGETIP || '127.0.0.1', port: 10304, pin: 'role:cd-salesforce,cmd:*'})
  .client({type: 'web', host: process.env.DOCKER_HOST_IP || process.env.TARGETIP || '127.0.0.1', port: 10301, pin: 'role:cd-dojos,cmd:*'});
});<commit_msg>Do seneca requires after migrations have run<commit_after>'use strict';

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

var _ =require('lodash');
var config = require('./config/config.js')();
var seneca = require('seneca')();

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

seneca.options(config);

seneca.use('postgresql-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']});
  seneca.use(require('./nodebb-api.js'), config.nodebb);

  seneca.listen()
  .client({type: 'web', host: process.env.DOCKER_HOST_IP || process.env.TARGETIP || '127.0.0.1', port: 10304, pin: 'role:cd-salesforce,cmd:*'})
  .client({type: 'web', host: process.env.DOCKER_HOST_IP || process.env.TARGETIP || '127.0.0.1', port: 10301, pin: 'role:cd-dojos,cmd:*'});
});
{'fraction_non_alphanumeric': 0.22937771345875543, 'fraction_numerical': 0.01881331403762663, 'mean_word_length': 5.552132701421801, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3332787', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1016, 'n_words': 150}