<commit_before>var Boom = require('boom');
var Bluebird = require('bluebird');
var Cron = require('cron-parser');
var Express = require('express');
var Jwt = require('jsonwebtoken');
var Webtask = require('webtask-tools');
var _ = require('lodash');

var app = Express();
var router = Express.Router();
var mongo;

// Check for required configuration parameters
app.use(function (req, res, next) {
    var data = req.webtaskContext.data;
    var required = ['JOB_COLLECTION', 'MONGO_URL', 'cluster_url'];

    for (var i in required) {
        var key = required[i];

        if (!data[key]) {
            var err = Boom.badGateway('Cron webtask needs to be configured '
                + 'with the parameter: `' + key + '`.');
            return next(err);
        }
    }

    next();
});

// Set up connection to mongodb
app.use(function (req, res, next) {
    // Short-cut if mongo is already setup<commit_msg>Remove `cluster_url` check for cron webtask<commit_after>var Boom = require('boom');
var Bluebird = require('bluebird');
var Cron = require('cron-parser');
var Express = require('express');
var Jwt = require('jsonwebtoken');
var Webtask = require('webtask-tools');
var _ = require('lodash');

var app = Express();
var router = Express.Router();
var mongo;

// Check for required configuration parameters
app.use(function (req, res, next) {
    var data = req.webtaskContext.data;
    var required = ['JOB_COLLECTION', 'MONGO_URL'];

    for (var i in required) {
        var key = required[i];

        if (!data[key]) {
            var err = Boom.badGateway('Cron webtask needs to be configured '
                + 'with the parameter: `' + key + '`.');
            return next(err);
        }
    }

    next();
});

// Set up connection to mongodb
app.use(function (req, res, next) {
    // Short-cut if mongo is already setup
{'fraction_non_alphanumeric': 0.14704286489419424, 'fraction_numerical': 0.0, 'mean_word_length': 3.0706401766004414, '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': '2469611', 'n_tokens_mistral': 584, 'n_tokens_neox': 570, 'n_words': 173}