[sync] remove unneeded for-comprehension
This commit is contained in:
parent
218c0114c2
commit
0931f82414
1 changed files with 7 additions and 10 deletions
|
@ -4,7 +4,6 @@ import java.io.File
|
|||
import java.time.Instant
|
||||
|
||||
import cats.effect._
|
||||
import net.kemitix.s3thorp.Main.putStrLn
|
||||
import net.kemitix.s3thorp.Sync.{Bucket, LocalFile, RemoteKey}
|
||||
import net.kemitix.s3thorp.awssdk.S3Client
|
||||
|
||||
|
@ -20,15 +19,13 @@ class Sync(s3Client: S3Client)
|
|||
override def upload(localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) =
|
||||
s3Client.upload(localFile, bucket, remoteKey)
|
||||
|
||||
def run(c: Config): IO[Unit] = for {
|
||||
_ <- putStrLn(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}")
|
||||
_ <- {
|
||||
streamDirectoryPaths(c.source).flatMap(
|
||||
enrichWithS3MetaData(c)).flatMap(
|
||||
uploadRequiredFilter(c)).flatMap(
|
||||
performUpload(c)).compile.drain
|
||||
}
|
||||
} yield ()
|
||||
def run(c: Config): IO[Unit] = {
|
||||
println(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}")
|
||||
streamDirectoryPaths(c.source).flatMap(
|
||||
enrichWithS3MetaData(c)).flatMap(
|
||||
uploadRequiredFilter(c)).flatMap(
|
||||
performUpload(c)).compile.drain
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue