private def onSuccess()

in app/com/gu/floodgate/reindex/ProgressTracker.scala [96:109]


  private def onSuccess(response: WSResponse, contentSource: ContentSource, runningJob: RunningJob): Unit = {
    response.json
      .validate[Progress]
      .fold(
        error => {
          logger.warn(
            s"Content source with id: ${contentSource.id} appears to be returning progress updates in an incorrect format. Marking reindex as cancelled and stop monitoring reindex."
          )
          // TODO: try to cancel the reindex op on the source, rather than just stop paying any attention to it
          completeProgressTracking(Cancelled, contentSource, runningJob)
        },
        progress => actOnProgress(progress, contentSource, runningJob)
      )
  }