Skip to content

Commit

Permalink
Shutdown http pools
Browse files Browse the repository at this point in the history
  • Loading branch information
2m committed Oct 19, 2017
1 parent f331ed3 commit ca66312
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions core/src/main/scala/Authors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ object Authors {

import sys.dispatcher

val completion =
DiffSource(repo, from, to)
.via(ActsonReader.instance)
.via(ProtocolReader.of(GithubProtocol.compareProto))
.via(StatsAggregator())
.via(SortingMachine())
.via(MarkdownConverter())
.runFold("")(_ ++ "\n" ++ _)

completion.onComplete(_ => sys.terminate())
completion
DiffSource(repo, from, to)
.via(ActsonReader.instance)
.via(ProtocolReader.of(GithubProtocol.compareProto))
.via(StatsAggregator())
.via(SortingMachine())
.via(MarkdownConverter())
.runFold("")(_ ++ "\n" ++ _)
.transformWith { res =>
for {
_ <- Http().shutdownAllConnectionPools()
_ <- sys.terminate()
r <- Future.fromTry(res)
} yield r
}
}

def gitRepo(path: String): FileRepository =
Expand Down

0 comments on commit ca66312

Please sign in to comment.