in app/models/Bake.scala [35:64]
def domain2db(bake: Bake): DbModel = DbModel(
recipeId = bake.recipe.id,
buildNumber = bake.buildNumber,
status = bake.status,
amiId = bake.amiId,
startedBy = bake.startedBy,
startedAt = bake.startedAt,
deleted = Some(bake.deleted)
)
def db2domain(dbModel: DbModel, recipe: Recipe): Bake = Bake(
recipe = recipe,
buildNumber = dbModel.buildNumber,
status = dbModel.status,
amiId = dbModel.amiId,
startedBy = dbModel.startedBy,
startedAt = dbModel.startedAt,
deleted = dbModel.deleted.getOrElse(false)
)
def updateStatusAndNotifyFailure(
bakeId: BakeId,
status: BakeStatus,
notificationConfig: Option[NotificationConfig]
)(implicit dynamo: Dynamo, exec: ExecutionContext): Unit = {
if (status == BakeStatus.Failed || status == BakeStatus.TimedOut) {
BakeFailedNotifier.notifyBakeFailed(bakeId, status, notificationConfig)
}
Bakes.updateStatus(bakeId, status)
}