Due to a scheduled upgrade to version 14.10, GitLab will be unavailabe on Monday 30.05., from 19:00 until 20:00.

Unverified Commit b1980295 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

add counter

parent 1f2e8fb5
Pipeline #22355 passed with stages
in 5 minutes and 18 seconds
......@@ -36,8 +36,14 @@ object App
case Some((sessionId, filters, dryRun)) =>
try {
val matches = Iterator.continually(poll)
.takeWhile(_.nonEmpty)
.flatten
.flatMap(record => Report(record) match {
.zip(Iterator.from(1))
.flatMap(record => {
if (record._2 % 250000 == 0) {
logger.info(s"${record._2} records processed so far")
}
Report(record._1) match {
case Success(rep) if filters.forall(f => f(rep)) =>
logger.debug("Match found")
List(DeleteMessage(rep, sessionId))
......@@ -48,8 +54,9 @@ object App
List()
case Failure(ex) =>
logger.warn(s"Ignoring message because parsing failed: ${ex.getMessage}")
logger.info(s"${record.value()}")
logger.info(s"${record._1.value()}")
List()
}
}).toSet
logger.info(s"${matches.size} matches found")
matches.foreach(msg => sendDelete(msg, dryRun))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment