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

list new recordSetId only once


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 957a6180
Pipeline #22372 passed with stages
in 5 minutes and 2 seconds
......@@ -21,6 +21,7 @@ package ch.memobase
import ch.memobase.models.{DeleteMessage, ParserIgnore, Report}
import org.apache.logging.log4j.scala.Logging
import scala.collection.mutable
import scala.util.{Failure, Success}
object App
......@@ -35,7 +36,7 @@ object App
parse(args) match {
case Some((sessionId, filters, dryRun)) =>
try {
var recordSetId = ""
val recordSetIds: mutable.HashSet[String] = mutable.HashSet()
val matches = Iterator.continually(poll)
.takeWhile(_.nonEmpty)
.flatten
......@@ -49,9 +50,9 @@ object App
logger.info("Match found")
List(DeleteMessage(rep, sessionId))
case Success(r) =>
if (r.recordSetId != recordSetId) {
recordSetId = r.recordSetId
logger.info(recordSetId)
if (!recordSetIds.contains(r.recordSetId)) {
recordSetIds += r.recordSetId
logger.info(r.recordSetId)
}
List()
case Failure(_: ParserIgnore) =>
......
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