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

ignore reports for institutions or recordSets


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 8c5fa785
Pipeline #22382 passed with stages
in 4 minutes and 58 seconds
......@@ -49,6 +49,11 @@ object Report {
throw new ParserIgnore("FATAL message: No record forwarded, therefore ignoring report")
}
val id = Try(json.obj("id").str).getOrElse(throw new ParserException("No `id` field in JSON obj"))
if (id.startsWith("https://memobase.ch/recordSet")) {
throw new ParserIgnore("Ignoring report because it is for a recordSet")
} else if (id.startsWith("https://memobase.ch/institution")) {
throw new ParserIgnore("Ignoring report because it is for an institution")
}
val timestampString = Try(json.obj("timestamp").str).getOrElse(throw new ParserException("No `timestamp` field in JSON obj"))
val timestamp = Try(dateFormatter.parse(timestampString))
.orElse(Try(shortDateFormatter.parse(timestampString)))
......
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