Skip to content

Commit c4959f7

Browse files
committed
Always fetch jobs when updating in-progress runs
1 parent edd838d commit c4959f7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/store/workflowRun.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ abstract class WorkflowRunBase {
3333
}
3434

3535
updateRun(run: model.WorkflowRun) {
36-
if (this._run.updated_at !== run.updated_at) {
37-
// Run has changed, reset jobs. Note: this doesn't work in all cases, there might be race conditions
38-
// where the run update_at field isn't set but the jobs change, but in the vast majority of cases the
39-
// combined status/conclusion of the run is updated whenever a job changes, so this should be good enough
40-
// for now to reduce the # of API calls
36+
if (this._run.status !== "completed" || this._run.updated_at !== run.updated_at) {
37+
// Refresh jobs if the run is not completed or it was updated (i.e. re-run)
38+
// For in-progress runs, we can't rely on updated at to change when jobs change
4139
this._jobs = undefined;
4240
}
4341

0 commit comments

Comments
 (0)