[s3metadataenricher] remove putStrLn
This commit is contained in:
parent
4e2729ae26
commit
df0df49624
1 changed files with 9 additions and 9 deletions
|
@ -4,7 +4,6 @@ import java.io.File
|
|||
|
||||
import fs2.Stream
|
||||
import cats.effect.IO
|
||||
import Main.putStrLn
|
||||
|
||||
trait S3MetaDataEnricher extends S3Client {
|
||||
|
||||
|
@ -15,13 +14,14 @@ trait S3MetaDataEnricher extends S3Client {
|
|||
def enrichWithS3MetaData(c: Config): File => Stream[IO, Either[File, S3MetaData]] = {
|
||||
val fileToString = generateKey(c)_
|
||||
file =>
|
||||
Stream.eval(for {
|
||||
_ <- putStrLn(s"enrich: $file")
|
||||
key = fileToString(file)
|
||||
Stream.eval({
|
||||
val key = fileToString(file)
|
||||
for {
|
||||
head <- objectHead(c.bucket, key)
|
||||
} yield head.map {
|
||||
case (hash,lastModified) =>
|
||||
Right(S3MetaData(file, key, hash, lastModified))
|
||||
}.getOrElse(Left(file)))
|
||||
}.getOrElse(Left(file))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue