Skip to content

Commit

Permalink
AndThen and Seq continuations
Browse files Browse the repository at this point in the history
  • Loading branch information
hvesalai committed Jan 16, 2018
1 parent f0776fb commit 4fd9289
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions slick/src/main/scala/slick/basic/BasicBackend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ trait BasicBackend { self =>
case AndThenAction(actions) =>
val last = actions.length - 1
def run(pos: Int, v: Any): Future[Any] = {
val f1 = runInContext(actions(pos), ctx, streaming && pos == last, pos == 0)
val f1 = runInContext(actions(pos), ctx, streaming && pos == last, topLevel && pos == 0)

if(pos == last) f1
else f1.flatMap(run(pos + 1, _))(DBIO.sameThreadExecutionContext)
}
Expand All @@ -166,7 +167,7 @@ trait BasicBackend { self =>
}
b.result()
}
else runInContext(actions(pos), ctx, false, pos == 0).flatMap { (v: Any) =>
else runInContext(actions(pos), ctx, false, topLevel && pos == 0).flatMap { (v: Any) =>
results.set(pos, v)
run(pos + 1)
} (DBIO.sameThreadExecutionContext)
Expand Down

0 comments on commit 4fd9289

Please sign in to comment.