def processContent()

in src/main/scala/com/gu/mobile/content/notifications/ContentLambda.scala [8:32]


  def processContent(content: Content): Boolean = {
    logger.info(s"Processing ContendId: ${content.id} Published at: ${content.getLoggablePublicationDate}")
    if (content.isRecent && content.followableTags.nonEmpty) {
      val haveSeen = dynamo.haveSeenContentItem(content.id)
      if (haveSeen) {
        logger.info(s"Ignoring duplicate content ${content.id}")
      } else {
        try {
          messageSender.send(content)
          dynamo.saveContentItem(content.id)
        } catch {
          case e: Exception =>
            logger.error(s"Unable to send notification for ${content.id}", e)
        }
      }
      !haveSeen
    } else {
      if (!content.isRecent) {
        logger.info(s"Ignoring older content ${content.id}")
      } else {
        logger.info(s"Ignoring content ${content.id} as it doesn't contain followable tags: ${content.tags}")
      }
      false
    }
  }