소스 검색

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 년 전
부모
커밋
63986aab87
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  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 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 {
         w => Ok(Json.toJson(w))