Skip to content

Commit

Permalink
fix listDisks and remove manualTestImports object
Browse files Browse the repository at this point in the history
  • Loading branch information
gpcarr committed May 18, 2020
1 parent 92e3f25 commit 3d84ff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,10 @@ private[google2] class GoogleDiskInterpreter[F[_]: Async: StructuredLogger: Time
Async[F].delay(diskClient.listDisks(projectZone)),
s"com.google.cloud.compute.v1.DiskClient.listDisks(${projectZone.toString})"
)
zoneString = s"${project.value}/zones/${zone.value}"
_ = println("firstPage: " + firstPageResults.toString)
nextPage <- Stream.unfoldEval(firstPageResults) { currentPage =>
println("currentPage: " + currentPage.getNextPageToken)
val tokenOpt = if (currentPage.getNextPageToken.isEmpty) None else Some(currentPage.getNextPageToken)
tokenOpt.traverse { token =>
val request = ListDisksHttpRequest.newBuilder()
.setZone(zoneString)
.setPageToken(token)
.build()
val response = retryF(
Async[F].delay(diskClient.listDisks(request)),
s"com.google.cloud.compute.v1.DiskClient.listDisks(${token})"
)
println("response: " + response.toString())
response.compile.lastOrError.map(next => (currentPage, next))
}
}
res <- Stream.fromIterator[F](nextPage.iterateAll().iterator().asScala)
_ = println("res: " + res.toString)

page <- Stream.fromIterator[F](firstPageResults.iteratePages().iterator().asScala)

res <- Stream.fromIterator[F](page.iterateAll().iterator().asScala)
} yield res
}

Expand Down

This file was deleted.

0 comments on commit 3d84ff6

Please sign in to comment.