fix: remove model elements that apparently don't get generated by DOMjudge sometimes

This commit is contained in:
Johannes Frohnmeyer 2024-05-12 17:11:48 +02:00
parent 378e3cc65c
commit 9bdf0026f0
Signed by: Johannes
GPG Key ID: E76429612C2929F4
3 changed files with 9 additions and 8 deletions

View File

@ -205,10 +205,10 @@ object SDom {
}.body() }.body()
println(response) println(response)
if (response.importError != null) { // if (response.importError != null) {
resultFlow.emit(Result.failure(Exception(response.importError))) // resultFlow.emit(Result.failure(Exception(response.importError)))
return@launch // return@launch
} // }
do { do {
val result: List<SDJudgement> = authenticatedClient.get(SDCredentials.url) { val result: List<SDJudgement> = authenticatedClient.get(SDCredentials.url) {
url { url {
@ -224,6 +224,7 @@ object SDom {
} }
} while (true) } while (true)
} catch (e: Exception) { } catch (e: Exception) {
logger.error("Failed to submit solution", e)
resultFlow.emit(Result.failure(e)) resultFlow.emit(Result.failure(e))
} }
} }

View File

@ -13,6 +13,6 @@ data class SDJudgement(
val id: String, val id: String,
val valid: Boolean, val valid: Boolean,
@SerialName("judgement_type_id") val judgementTypeId: String?, @SerialName("judgement_type_id") val judgementTypeId: String?,
@SerialName("judgehost") val judgeHost: String?, // not needed @SerialName("judgehost") val judgeHost: String?,
@SerialName("max_run_time") val maxRunTime: Float?, @SerialName("max_run_time") val maxRunTime: Float?,
) )

View File

@ -10,9 +10,9 @@ data class SDSubmission(
@SerialName("contest_time") val contestTime: String, @SerialName("contest_time") val contestTime: String,
@SerialName("team_id") val teamId: String, @SerialName("team_id") val teamId: String,
@SerialName("problem_id") val problemId: String, @SerialName("problem_id") val problemId: String,
val files: List<FileWithName>?, //not needed val files: List<FileWithName>?,
val id: String, val id: String,
@SerialName("external_id") val externalId: String?, @SerialName("external_id") val externalId: String?,
@SerialName("entry_point") val entryPoint: String?, //not needed @SerialName("entry_point") val entryPoint: String?,
@SerialName("import_error") val importError: String?, //not needed, I guess? @SerialName("import_error") val importError: String?,
) )