11import { setInterval } from "timers" ;
22import { EventEmitter } from "vscode" ;
33import { GitHubRepoContext } from "../git/repository" ;
4- import { logDebug } from "../log" ;
4+ import { log , logDebug } from "../log" ;
55import * as model from "../model" ;
66import { WorkflowRun } from "./workflowRun" ;
77
@@ -46,6 +46,7 @@ export class RunStore extends EventEmitter<RunStoreEvent> {
4646 * Start polling for updates for the given run
4747 */
4848 pollRun ( runId : number , repoContext : GitHubRepoContext , intervalMs : number , attempts = 10 ) {
49+ log ( `Starting polling for run ${ runId } every ${ intervalMs } ms for ${ attempts } attempts` ) ;
4950 const existingUpdater : Updater | undefined = this . updaters . get ( runId ) ;
5051 if ( existingUpdater && existingUpdater . handle ) {
5152 clearInterval ( existingUpdater . handle ) ;
@@ -65,7 +66,7 @@ export class RunStore extends EventEmitter<RunStoreEvent> {
6566 }
6667
6768 private async fetchRun ( updater : Updater ) {
68- logDebug ( "Updating run: " , updater . runId ) ;
69+ log ( `Fetching run update: ${ updater . runId } . Remaining attempts: ${ updater . remainingAttempts } ` ) ;
6970
7071 updater . remainingAttempts -- ;
7172 if ( updater . remainingAttempts === 0 ) {
@@ -83,7 +84,7 @@ export class RunStore extends EventEmitter<RunStoreEvent> {
8384 } ) ;
8485
8586 const run = result . data ;
86- logDebug ( " Polled run:" , run . id , " Status:" , run . status , " Conclusion:" , run . conclusion ) ;
87+ log ( ` Polled run: ${ run . id } Status: ${ run . status } Conclusion: ${ run . conclusion } ` ) ;
8788 this . addRun ( updater . repoContext , run ) ;
8889
8990 if ( run . status === "completed" || run . status === "cancelled" || run . status === "failure" || run . status === "success" || run . status === "skipped" || run . status === "timed_out" ) {
0 commit comments