<commit_before>var cwd = process.cwd();

require(cwd + "/lib/env");
var fioApiKey = process.env.FORECAST_IO_API_KEY;

// 4 minutes and 30 seconds, because
// we'll be logging every 5 minutes and we
// want to make sure we get fresh data on
// each poll.
var cacheExpiration = (4 * 60) + 30;
// var cacheExpiration = 5;

var cache = require('memjs').Client.create();
var ForecastIo = require('forecast.io');
var forecastIo = new ForecastIo({APIKey: fioApiKey});

module.exports = {

  getForecast: function(lat, lng, callback) {
    var cacheKey = "weather.forecast:" + lat + "," + lng
    cache.get(cacheKey, function(mcErr, fc){
      if (mcErr) console.error(err);
      
      if (fc)  {
        cache.close();
        return callback(null, JSON.parse(fc));
      }

      forecastIo.get(lat, lng, function(fioErr, res, data){
        if (fioErr) return callback(fioErr);

        var fc = data;
<commit_msg>Correct reference to memcache error variable<commit_after>var cwd = process.cwd();

require(cwd + "/lib/env");
var fioApiKey = process.env.FORECAST_IO_API_KEY;

// 4 minutes and 30 seconds, because
// we'll be logging every 5 minutes and we
// want to make sure we get fresh data on
// each poll.
var cacheExpiration = (4 * 60) + 30;
// var cacheExpiration = 5;

var cache = require('memjs').Client.create();
var ForecastIo = require('forecast.io');
var forecastIo = new ForecastIo({APIKey: fioApiKey});

module.exports = {

  getForecast: function(lat, lng, callback) {
    var cacheKey = "weather.forecast:" + lat + "," + lng
    cache.get(cacheKey, function(mcErr, fc){
      if (mcErr) console.error(mcErr);
      
      if (fc)  {
        cache.close();
        return callback(null, JSON.parse(fc));
      }

      forecastIo.get(lat, lng, function(fioErr, res, data){
        if (fioErr) return callback(fioErr);

        var fc = data;

{'fraction_non_alphanumeric': 0.13908355795148247, 'fraction_numerical': 0.01078167115902965, 'mean_word_length': 3.18018018018018, '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': '7617271', 'n_tokens_mistral': 645, 'n_tokens_neox': 617, 'n_words': 177}