s3_website_monadic 0.0.28 → 0.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/s3_website/version.rb +1 -1
- data/src/main/scala/s3/website/Push.scala +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e67a3b50d099328d1163b4ab28bb19ab5ea70bb2
|
4
|
+
data.tar.gz: 87cb81ba31dcc20734987b90d194ea95a5d7d84a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dde895e0d896fca1d47dfa8bb5b2ed599f698c037ef4c3cb870cbe4cfe86603964b0eb87fed90e2d45f1253b79a59600f995653fcbe31470a95e955a5544d074
|
7
|
+
data.tar.gz: 479a0f6a3c586f26833a0fc2076bddbcc94618b2b40de911422337e874a3fa4c2018be98662e19571dfa81fab508776e9333f888b455a9eac66962d42218fbc4
|
data/lib/s3_website/version.rb
CHANGED
@@ -105,10 +105,8 @@ object Push {
|
|
105
105
|
|
106
106
|
def afterPushFinished(errorsOrFinishedUploads: Either[ErrorReport, FinishedPushOperations], invalidationSucceeded: Option[Boolean])
|
107
107
|
(implicit config: Config, logger: Logger, pushMode: PushMode): ExitCode = {
|
108
|
-
errorsOrFinishedUploads.right.
|
109
|
-
|
110
|
-
logger.info(s"Summary: $pushCounts")
|
111
|
-
}
|
108
|
+
val pushCountsOption = errorsOrFinishedUploads.right.map(resolvePushCounts(_)).right.toOption
|
109
|
+
pushCountsOption.map(pushCountsToString).foreach(pushCounts => logger.info(s"Summary: $pushCounts"))
|
112
110
|
errorsOrFinishedUploads.left foreach (err => logger.fail(s"Encountered an error: ${err.reportMessage}"))
|
113
111
|
val exitCode = errorsOrFinishedUploads.fold(
|
114
112
|
_ => 1,
|
@@ -124,7 +122,7 @@ object Push {
|
|
124
122
|
)
|
125
123
|
|
126
124
|
exitCode match {
|
127
|
-
case 0 if !pushMode.dryRun =>
|
125
|
+
case 0 if !pushMode.dryRun && pushCountsOption.exists(_.thereWasSomethingToPush) =>
|
128
126
|
logger.info(s"Successfully pushed the website to http://${config.s3_bucket}.${config.s3_endpoint.s3WebsiteHostname}")
|
129
127
|
case 1 =>
|
130
128
|
logger.fail(s"Failed to push the website to http://${config.s3_bucket}.${config.s3_endpoint.s3WebsiteHostname}")
|
@@ -176,7 +174,9 @@ object Push {
|
|
176
174
|
failures: Int = 0,
|
177
175
|
redirects: Int = 0,
|
178
176
|
deletes: Int = 0
|
179
|
-
)
|
177
|
+
) {
|
178
|
+
val thereWasSomethingToPush = updates + newFiles + redirects + deletes > 0
|
179
|
+
}
|
180
180
|
type FinishedPushOperations = ParSeq[Either[ErrorReport, PushErrorOrSuccess]]
|
181
181
|
type PushReports = ParSeq[Either[ErrorReport, Future[PushErrorOrSuccess]]]
|
182
182
|
case class PushResult(threadPool: ExecutorService, uploadReports: PushReports)
|