<commit_before>module.exports.init = function(config){
  var session = require('express-session');

  var sessionMiddleware, useConnectEtcdSession, useConnectRedisSession;
  try {
      useConnectEtcdSession = require.resolve("connect-etcd");
  } catch(e) {
  }

  try {
      useConnectRedisSession = require.resolve("connect-redis");
  } catch(e) {
  }

  if (useConnectEtcdSession) {
    var EtcdStore = require('connect-etcd')(session);

    sessionMiddleware = session({
        store: new EtcdStore({url: config.etcdHost, port: config.etcdPort}),
        secret: 'hobknob'
    });
  }
  else if (useConnectRedisSession) {
    var RedisStore = require('connect-redis')(session);

    sessionMiddleware = session({
        store: new RedisStore({host: config.redisHost, port: config.redisPort}),
        secret: 'hobknob'
    });
  }
  else {
    sessionMiddleware = express.session();
  }

  return sessionMiddleware;
}
<commit_msg>service-status and lbstatus pages are really sessionless this time<commit_after>module.exports.init = function(config){
  var session = require('express-session');

  var sessionMiddleware, useConnectEtcdSession, useConnectRedisSession;
  try {
      useConnectEtcdSession = require.resolve("connect-etcd");
  } catch(e) {
  }

  try {
      useConnectRedisSession = require.resolve("connect-redis");
  } catch(e) {
  }

  if (useConnectEtcdSession) {
    var EtcdStore = require('connect-etcd')(session);

    sessionMiddleware = session({
        store: new EtcdStore({url: config.etcdHost, port: config.etcdPort}),
        secret: 'hobknob'
    });
  }
  else if (useConnectRedisSession) {
    var RedisStore = require('connect-redis')(session);

    sessionMiddleware = session({
        store: new RedisStore({host: config.redisHost, port: config.redisPort}),
        secret: 'hobknob'
    });
  }
  else {
    sessionMiddleware = express.session();
  }

  return function(req, res, next){
    if(req.path === '/service-status' || req.path === '/_lbstatus'){
      return next();
    }

    return sessionMiddleware(req, res, next);
  } ;
}

{'fraction_non_alphanumeric': 0.13442150744119058, 'fraction_numerical': 0.0, 'mean_word_length': 3.5701754385964914, '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': '870625', 'n_tokens_mistral': 663, 'n_tokens_neox': 653, 'n_words': 126}