Permalink
Browse files

changing Assets's lastModifieds and etags to ConcurrentMap

  • Loading branch information...
1 parent 6209092 commit 5698130921a6129b4ca24c02c1e2645d2e1e97e4 @pk11 pk11 committed Mar 10, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 documentation/manual
  2. +3 −2 framework/src/play/src/main/scala/play/api/controllers/Assets.scala
@@ -10,6 +10,7 @@ import Play.current
import java.io._
import scalax.io.{ Resource }
import java.text.SimpleDateFormat
+import collection.JavaConverters._
/**
* Controller that serves static resources.
@@ -122,7 +123,7 @@ object Assets extends Controller {
formatter
}
- private val lastModifieds = scala.collection.mutable.HashMap.empty[String, String]
+ private val lastModifieds = (new java.util.concurrent.ConcurrentHashMap[String,String]()).asScala
private def lastModifiedFor(resource: java.net.URL): Option[String] = {
lastModifieds.get(resource.toExternalForm).filter(_ => Play.isProd).orElse {
@@ -143,7 +144,7 @@ object Assets extends Controller {
// -- ETags handling
- private val etags = scala.collection.mutable.HashMap.empty[String, String]
+ private val etags = (new java.util.concurrent.ConcurrentHashMap[String,String]()).asScala
private def etagFor(resource: java.net.URL): Option[String] = {
etags.get(resource.toExternalForm).filter(_ => Play.isProd).orElse {

0 comments on commit 5698130

Please sign in to comment.