<commit_before>const db = require('./db')

function cache ({fn, minutes=5, log=''}) {
  this.expires = new Date(new Date().getTime() + minutes *  60 * 1000)
  this.result = false
  this.resolve = () => {
    if (this.result && this.expires > new Date().getTime()) {
      console.log(`${log + ' - '}Cache hit - Expires at ${this.expires.toString()}`)
      return Promise.all([])
        .then(() => this.result)
    } else {
      console.log(`${log + ' - '}Cache miss - Expires at ${this.expires.toString()}`)
      return Promise.all([])
        .then(() => fn())
        .then(res => {
          console.log(`${log + ' - '}Response obtained at ${new Date().toString()}`)<commit_msg>removing logs to reduce logs usage at Now.sh<commit_after>const db = require('./db')

function cache ({fn, minutes=5, log=''}) {
  this.expires = new Date(new Date().getTime() + minutes *  60 * 1000)
  this.result = false
  this.resolve = () => {
    if (this.result && this.expires > new Date().getTime()) {
      // console.log(`${log + ' - '}Cache hit - Expires at ${this.expires.toString()}`)
      return Promise.all([])
        .then(() => this.result)
    } else {
      // console.log(`${log + ' - '}Cache miss - Expires at ${this.expires.toString()}`)
      return Promise.all([])
        .then(() => fn())
        .then(res => {
          // console.log(`${log + ' - '}Response obtained at ${new Date().toString()}`)
{'fraction_non_alphanumeric': 0.21600566572237961, 'fraction_numerical': 0.009915014164305949, 'mean_word_length': 2.6796875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2699629', 'n_tokens_mistral': 464, 'n_tokens_neox': 453, 'n_words': 108}