Skip to content

Commit

Permalink
Added recovery for broken runs and disabled the start run button if t…
Browse files Browse the repository at this point in the history
…here are no tasks or are no teams
  • Loading branch information
sauterl committed May 24, 2024
1 parent cded493 commit 12286bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 13 additions & 3 deletions backend/src/main/kotlin/dev/dres/run/RunExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,19 @@ object RunExecutor {
DbEvaluation.filter { (it.ended eq null) }.asSequence().forEach { evaluation ->
try {
this.schedule(evaluation.toRunManager(store)) /* Re-schedule evaluations. */
} catch (e: IllegalStateException) {
logger.error("Could not re-schedule previous run: ${e.message}")
evaluation.ended = System.currentTimeMillis()
} catch (e: RuntimeException) {
when (e) {
is IllegalStateException,
is IllegalArgumentException -> {
logger.error("Could not re-schedule previous run: ${e.message}")
evaluation.ended = System.currentTimeMillis()
}

else -> {
logger.error("Fatal error during re-scheduling of previous run (${evaluation.evaluationId}): ${e.message}")
throw e
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1>Evaluation Templates</h1>
<mat-spinner *ngIf="waitingForRun[row.id]" [diameter]="20"></mat-spinner>
<span *ngIf="!waitingForRun[row.id]">
<button
[disabled]="row.taskCount == 0 || row.teamCount == 0"
mat-icon-button
aria-label="Start new evaluation run from template."
matTooltip="Start new evaluation run from template."
Expand Down

0 comments on commit 12286bd

Please sign in to comment.