Browse Source

No need to generate a parallel range - will just add to the elapsed time as generating 10 futures is a short lived operation and doesn't require parallelism.

Christopher Hunt 12 years ago
parent
commit
c8de17092c
1 changed files with 3 additions and 2 deletions
  1. 3 2
      play-scala/app/controllers/Application.scala

+ 3 - 2
play-scala/app/controllers/Application.scala

@@ -25,8 +25,9 @@ object Application extends Controller {
       val random = ThreadLocalRandom.current()
       val random = ThreadLocalRandom.current()
 
 
       val worlds = Future.sequence( (for {
       val worlds = Future.sequence( (for {
-        _ <- (1 to queries).par
-      } yield Future(World.findById(random.nextInt(TEST_DATABASE_ROWS) + 1))(dbEc)).toList)
+            _ <- 1 to queries
+          } yield Future(World.findById(random.nextInt(TEST_DATABASE_ROWS) + 1))(dbEc)
+        ).toList)
 
 
       worlds map {
       worlds map {
         w => Ok(Json.toJson(w))  
         w => Ok(Json.toJson(w))