def check()

in src/main/scala/ophan/google/index/checker/Lambda.scala [80:91]


  def check(contentSummaries: Set[ContentSummary]): Future[Map[String, AvailabilityRecord]] = {
    println(s"Checking Google index for ${contentSummaries.size} content items")
    Future.traverse(contentSummaries) { content =>
      for {
        checkReport <- googleSearchService.contentAvailabilityInGoogleIndex(content)
        updatedAvailabilityRecord <- dataStore.update(content.id, checkReport)
      } yield updatedAvailabilityRecord
    }.map(_.flatten.map(record => record.capiId -> record).toMap)
//    val successfulIndexStateChecks = checkReports.values.count(_.accessGoogleIndex.isSuccess)
//    println(s"Search Index checks: $successfulIndexStateChecks/${contentThatNeedsCheckingNow.size} accessed Google's API without error")

  }