[cli] Program handle actions list in stack safe manner (#93)

This commit is contained in:
Paul Campbell 2019-06-30 08:47:51 +01:00 committed by GitHub
parent c23376a037
commit 0fa8382fa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,8 +31,8 @@ trait Program {
private def handleActions(archive: ThorpArchive,
actions: Stream[Action]): IO[Stream[StorageQueueEvent]] =
actions.foldRight(Stream[IO[StorageQueueEvent]]()) {
(action, stream) => archive.update(action) ++ stream
actions.foldLeft(Stream[IO[StorageQueueEvent]]()) {
(stream, action) => archive.update(action) ++ stream
}.sequence
}