[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 java.time.Instant
|
||||||
|
|
||||||
import cats.effect._
|
import cats.effect._
|
||||||
import net.kemitix.s3thorp.Main.putStrLn
|
|
||||||
import net.kemitix.s3thorp.Sync.{Bucket, LocalFile, RemoteKey}
|
import net.kemitix.s3thorp.Sync.{Bucket, LocalFile, RemoteKey}
|
||||||
import net.kemitix.s3thorp.awssdk.S3Client
|
import net.kemitix.s3thorp.awssdk.S3Client
|
||||||
|
|
||||||
|
@ -20,15 +19,13 @@ class Sync(s3Client: S3Client)
|
||||||
override def upload(localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) =
|
override def upload(localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) =
|
||||||
s3Client.upload(localFile, bucket, remoteKey)
|
s3Client.upload(localFile, bucket, remoteKey)
|
||||||
|
|
||||||
def run(c: Config): IO[Unit] = for {
|
def run(c: Config): IO[Unit] = {
|
||||||
_ <- putStrLn(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}")
|
println(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}")
|
||||||
_ <- {
|
streamDirectoryPaths(c.source).flatMap(
|
||||||
streamDirectoryPaths(c.source).flatMap(
|
enrichWithS3MetaData(c)).flatMap(
|
||||||
enrichWithS3MetaData(c)).flatMap(
|
uploadRequiredFilter(c)).flatMap(
|
||||||
uploadRequiredFilter(c)).flatMap(
|
performUpload(c)).compile.drain
|
||||||
performUpload(c)).compile.drain
|
}
|
||||||
}
|
|
||||||
} yield ()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue