<commit_before>angular.module('app.data', [])
.service('Data', function($http) {
  var lastGoodDataDate = null;
  var lookingUp = false;
  var get = function() {
    return new Promise(function(resolve, reject) {
      console.log('run');
      $http({
        method: 'GET',
        url: '/api/chats/' + lastGoodDataDate
      })
      .then(function(chats) {
        console.log('finish');
        if (chats && chats.data && Array.isArray(chats.data) && chats.data.length > 0) {
          lastGoodDataDate = chats.data[chats.data.length - 1].createdOn;
        }
        resolve(chats.data);
      }).catch(function(err) {
        reject(err);
      }); 
    });
  };
  var public = function() {
    return $http({
      method: 'GET',
      url: '/api/public'
    })
    .then(function(chats) {
      if (chats && chats.data && Array.isArray(chats.data) && chats.data.length > 0) {
        lastGoodDataDate = chats.data[chats.data.length - 1].createdOn;
      }
      return chats.data;
    });
  };
  var post = function(message) {
    return $http({
      method: 'POST',
      url: '/api/post',
      data: {text: message}
    })
    .then(function(chats) {
      return chats.data;
    });
  };
  return {
    get: get,
    post: post,
    public: public
  };
});<commit_msg>Timing change for heroku<commit_after>angular.module('app.data', [])
.service('Data', function($http) {
  var lastGoodDataDate = null;
  var lookingUp = false;
  var get = function() {
    return new Promise(function(resolve, reject) {
      console.log('run');
      if (!lookingUp) {
        lookingUp = true;
        $http({
          method: 'GET',
          url: '/api/chats/' + lastGoodDataDate
        })
        .then(function(chats) {
          console.log('finish');
          if (chats && chats.data && Array.isArray(chats.data) && chats.data.length > 0) {
            lastGoodDataDate = chats.data[chats.data.length - 1].createdOn;
          }
          lookingUp = false;
          resolve(chats.data);
        }).catch(function(err) {
          lookingUp = false;
          reject(err);
        });
      } else {
        promise.resolve([]);
      }
    });
  };
  var public = function() {
    return $http({
      method: 'GET',
      url: '/api/public'
    })
    .then(function(chats) {
      if (chats && chats.data && Array.isArray(chats.data) && chats.data.length > 0) {
        lastGoodDataDate = chats.data[chats.data.length - 1].createdOn;
      }
      return chats.data;
    });
  };
  var post = function(message) {
    return $http({
      method: 'POST',
      url: '/api/post',
      data: {text: message}
    })
    .then(function(chats) {
      return chats.data;
    });
  };
  return {
    get: get,
    post: post,
    public: public
  };
});
{'fraction_non_alphanumeric': 0.16557971014492753, 'fraction_numerical': 0.002898550724637681, 'mean_word_length': 2.064372918978912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5802097', 'n_tokens_mistral': 919, 'n_tokens_neox': 914, 'n_words': 173}