Skip to content

Commit decdefa

Browse files
committed
Fix #229: Improve polling duration and stop condition
1 parent 0e7ed61 commit decdefa

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/commands/triggerWorkflowRun.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ export function registerTriggerWorkflowRun(context: vscode.ExtensionContext, sto
172172
const newLatestRunId = result.data.workflow_runs[0]?.id;
173173
if (newLatestRunId && newLatestRunId !== latestRunId) {
174174
await vscode.commands.executeCommand("github-actions.explorer.refresh");
175-
store.pollRun(newLatestRunId, gitHubRepoContext, 1000, 20);
175+
// Poll for 15 minutes (225 * 4s)
176+
store.pollRun(newLatestRunId, gitHubRepoContext, 4000, 225);
176177
break;
177178
}
178179
} catch (e) {

src/store/store.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,12 @@ export class RunStore extends EventEmitter<RunStoreEvent> {
8484

8585
const run = result.data;
8686
this.addRun(updater.repoContext, run);
87+
88+
if (run.status === "completed" || run.status === "cancelled" || run.status === "failure" || run.status === "success" || run.status === "skipped" || run.status === "timed_out") {
89+
if (updater.handle) {
90+
clearInterval(updater.handle);
91+
}
92+
this.updaters.delete(updater.runId);
93+
}
8794
}
8895
}

0 commit comments

Comments
 (0)