<commit_before>package controllers

import play.api._
import cache.Cached
import play.api.Play.current
import libs.concurrent.Akka
import mvc._
import play.api.libs.json._

import impl.lunchInfo._

object LunchInfo extends Controller {

  def index = Action { request =>
    Ok(views.html.lunchInfo.index())
  }

  def todaysLunches = Cached("todaysLunches", 60 * 10) {
    Action { request =>
      val todaysLunchesPromise = Akka.future { LunchInfoFetcher.fetchTodaysLunchInfo }
      Async {
        todaysLunchesPromise.map(todaysLunches => Ok(views.html.lunchInfo.todaysLunches(todaysLunches)))
      }
    }
  }

  def fetchLunchInfo = Action { request =>

    /*
    request.body.asJson.map { json =>
      (json \ "name").asOpt[String].map { name =>
        Ok("Hello " + name)
      }.getOrElse {
        BadRequest("Missing parameter [name]")
      }
    }.getOrElse {
      BadRequest("Expecting Json impl")
    }
    */

    val json = Json.toJson(
      Map("status" -> "OK")
    )

    Ok(json)

  }

  def fetchLunchInfoExample = Action { request =>
    val json = Json.toJson(
      Map("status" -> "OK")
    )

    Ok(json)
  }
}<commit_msg>Set no-cache on todaysLunches response<commit_after>package controllers

import play.api._
import cache.Cached
import play.api.Play.current
import libs.concurrent.Akka
import mvc._
import play.api.libs.json._

import impl.lunchInfo._

object LunchInfo extends Controller {

  def index = Action { request =>
    Ok(views.html.lunchInfo.index())
  }

  def todaysLunches = Cached("todaysLunches", 60 * 10) {
    Action { request =>
      val todaysLunchesPromise = Akka.future { LunchInfoFetcher.fetchTodaysLunchInfo }
      Async {
        todaysLunchesPromise.map(todaysLunches =>
          Ok(views.html.lunchInfo.todaysLunches(todaysLunches)).withHeaders(PRAGMA -> "no-cache")
        )
      }
    }
  }

  def fetchLunchInfo = Action { request =>

    /*
    request.body.asJson.map { json =>
      (json \ "name").asOpt[String].map { name =>
        Ok("Hello " + name)
      }.getOrElse {
        BadRequest("Missing parameter [name]")
      }
    }.getOrElse {
      BadRequest("Expecting Json impl")
    }
    */

    val json = Json.toJson(
      Map("status" -> "OK")
    )

    Ok(json)

  }

  def fetchLunchInfoExample = Action { request =>
    val json = Json.toJson(
      Map("status" -> "OK")
    )

    Ok(json)
  }
}
{'fraction_non_alphanumeric': 0.12656641604010024, 'fraction_numerical': 0.003341687552213868, 'mean_word_length': 2.5853293413173652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, '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': '643971', 'n_tokens_mistral': 835, 'n_tokens_neox': 812, 'n_words': 153}