In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

This Server has been upgraded to GitLab release 14.2.6

Commit 3ea4c13e authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Remove processed reports!

parent ecd51662
Pipeline #27923 passed with stages
in 4 minutes and 10 seconds
......@@ -55,25 +55,32 @@ class ReportCollector(private val importApiUrl: String) {
fun check() {
val removedKeys = collection
.filter { it.value.fatal || hasRequired(it.value.stepsCompleted, it.value.type) }
.map { it.value.toRequestBody().toJson(klaxon) }
.forEach {
.map {"Sending report for report ${it.value.identifier}.")
Pair(it.key, it.value.toRequestBody().toJson(klaxon))
.map {
val con = url.openConnection()
val http = con as HttpURLConnection
http.requestMethod = "POST"
http.doOutput = true
http.setRequestProperty("Content-Type", "application/json; charset=UTF-8")
http.outputStream.use { os -> os.write(it) }
http.outputStream.use { os -> os.write(it.second) }
if (http.responseCode >= 400) {
http.errorStream.use { errorStream ->
log.error(errorStream.bufferedReader().lines().reduce { s: String?, s2: String? -> s + s2 })
for (key in removedKeys)
private fun hasRequired(completed: Int, type: Type): Boolean {
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