in football/src/main/scala/com/gu/mobile/notifications/football/lib/EventFilter.scala [22:37]
private def filterNotification(notification: NotificationPayload)(implicit ec: ExecutionContext): Future[Option[NotificationPayload]] = {
if (!processedEvents.get.contains(notification.id)) {
distinctCheck.insertNotification(notification).map {
case Distinct =>
cache(notification.id)
Some(notification)
case Duplicate =>
cache(notification.id)
None
case _ => None
}
} else {
logger.debug(s"Event ${notification.id} already exists in local cache or does not have an id - discarding")
Future.successful(None)
}
}