src/main/scala/s3/website/S3.scala in s3_website-2.1.6 vs src/main/scala/s3/website/S3.scala in s3_website-2.1.7

- old
+ new

@@ -33,11 +33,11 @@ if (pushMode.dryRun) None else Some(recordUploadDuration(putObjectRequest, s3Settings.s3Client(config) putObject putObjectRequest)) val report = SuccessfulUpload( source.fold(_.s3Key, _.s3Key), source.fold( - upload => Left(SuccessfulNewOrCreatedDetails(upload.uploadType, upload.uploadFile.get.length(), uploadDuration, upload.reasonForUpload)), + upload => Left(SuccessfulNewOrCreatedDetails(upload.uploadType, upload.uploadFile.get.length(), uploadDuration)), redirect => Right(SuccessfulRedirectDetails(redirect.uploadType, redirect.redirectTarget)) ), putObjectRequest ) logger.info(report) @@ -144,11 +144,11 @@ sealed trait PushSuccessReport extends SuccessReport { def s3Key: String } case class SuccessfulRedirectDetails(uploadType: UploadType, redirectTarget: String) - case class SuccessfulNewOrCreatedDetails(uploadType: UploadType, uploadSize: Long, uploadDuration: Option[Long], reasonForUpload: String) + case class SuccessfulNewOrCreatedDetails(uploadType: UploadType, uploadSize: Long, uploadDuration: Option[Long]) case class SuccessfulUpload(s3Key: S3Key, details: Either[SuccessfulNewOrCreatedDetails, SuccessfulRedirectDetails], putObjectRequest: PutObjectRequest) (implicit pushMode: PushMode, logger: Logger) extends PushSuccessReport { @@ -165,22 +165,14 @@ md.getCacheControl :: md.getContentType :: md.getContentEncoding :: putObjectRequest.getStorageClass :: Nil map (Option(_)) // AWS SDK may return nulls - ) :+ uploadSizeForHumans :+ uploadSpeedForHumans :+ uploadReason + ) :+ uploadSizeForHumans :+ uploadSpeedForHumans detailFragments.collect { case Some(detailFragment) => detailFragment }.mkString(" | ") } - - lazy val uploadReason = - details - .fold(uploadDetails => Some(uploadDetails.reasonForUpload), _ => None) - .collect { - case reasonForUpload if logger.verboseOutput => - s"upload reason: $reasonForUpload" - } lazy val uploadSize = details.fold( newOrCreatedDetails => Some(newOrCreatedDetails.uploadSize), redirectDetails => None )