[s3metadataenricher] remove putStrLn

This commit is contained in:
Paul Campbell 2019-05-09 08:29:18 +01:00
parent 4e2729ae26
commit df0df49624

View file

@ -4,7 +4,6 @@ import java.io.File
import fs2.Stream import fs2.Stream
import cats.effect.IO import cats.effect.IO
import Main.putStrLn
trait S3MetaDataEnricher extends S3Client { trait S3MetaDataEnricher extends S3Client {
@ -15,13 +14,14 @@ trait S3MetaDataEnricher extends S3Client {
def enrichWithS3MetaData(c: Config): File => Stream[IO, Either[File, S3MetaData]] = { def enrichWithS3MetaData(c: Config): File => Stream[IO, Either[File, S3MetaData]] = {
val fileToString = generateKey(c)_ val fileToString = generateKey(c)_
file => file =>
Stream.eval(for { Stream.eval({
_ <- putStrLn(s"enrich: $file") val key = fileToString(file)
key = fileToString(file) for {
head <- objectHead(c.bucket, key) head <- objectHead(c.bucket, key)
} yield head.map { } yield head.map {
case (hash,lastModified) => case (hash,lastModified) =>
Right(S3MetaData(file, key, hash, lastModified)) Right(S3MetaData(file, key, hash, lastModified))
}.getOrElse(Left(file))) }.getOrElse(Left(file))
})
} }
} }