in app/notification/BakeFailedNotifier.scala [80:106]
def notifyBakeFailed(
bakeId: BakeId,
bakeStatus: BakeStatus,
notificationConfig: Option[NotificationConfig]
)(implicit exec: ExecutionContext, dynamo: Dynamo): Unit = {
val notificationResult = for {
config <- notificationConfig
bake <- Bakes.findById(bakeId.recipeId, bakeId.buildNumber)
notification <- makeNotification(bake, bakeStatus, config)
} yield {
Anghammarad
.notify(notification, config.snsTopicArn, config.snsClient)
.onComplete {
case Success(value) =>
log.info(
s"Sent notification to anghammarard about recipe ${bake.recipe.id} bake failure. Status: $value"
)
case Failure(exception) =>
log.error(
s"Failed to send notification about recipe ${bake.recipe.id} bake failure",
exception
)
}
}
if (notificationResult.isEmpty)
logFailure(notificationConfig.isEmpty, bakeId)
}