From 1982686e006b12b8d97c42671769953375d42695 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 6 May 2019 22:37:16 +0100 Subject: [PATCH] [sync] log files found --- src/main/scala/net/kemitix/s3thorp/Sync.scala | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/scala/net/kemitix/s3thorp/Sync.scala b/src/main/scala/net/kemitix/s3thorp/Sync.scala index ee29d1f..bf3459a 100644 --- a/src/main/scala/net/kemitix/s3thorp/Sync.scala +++ b/src/main/scala/net/kemitix/s3thorp/Sync.scala @@ -44,22 +44,25 @@ object Sync { flatMap(recurseIntoSubDirectories) } - case class S3MetaData() + case class S3MetaData(localPath: Path) - private def enrichWithS3MetaData: Path => Stream[IO, S3MetaData] = path => { + private def enrichWithS3MetaData: Path => Stream[IO, S3MetaData] = path => Stream.eval(for { + _ <- putStrLn(s"enrich: $path") // HEAD(bucket, prefix, relative(path)) // create blank S3MetaData records (sealed trait?) - } + } yield S3MetaData(localPath = path)) private def uploadRequiredFilter: S3MetaData => Stream[IO, Path] = - s3Metadata => { + s3Metadata => Stream.eval(for { + _ <- putStrLn(s"upload required: ${s3Metadata.localPath}") //md5File(localFile) //filter(localHash => options.force || localHash != metadataHash) - } + } yield s3Metadata.localPath) private def performUpload: Path => Stream[IO, Promise[Unit]] = - path => { + path => Stream.eval(for { + _ <- putStrLn(s"upload: $path") // upload - IO.unit - } + p = Promise[Unit]() + } yield p) }